From 10e93d69a3bb1e0d727f47be3ceca4fb4562a34c Mon Sep 17 00:00:00 2001 From: ai-bot Date: Mon, 16 Nov 2026 19:22:18 +0000 Subject: [PATCH] Decide when the bank may be named --- app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app.py b/app.py index ae41892..50e0967 100644 --- a/app.py +++ b/app.py @@ -195,6 +195,14 @@ def _drop_ledger(conn): conn.execute("DELETE FROM lots") +def _may_name_bank(tx, bank_id): + """Say whether a transaction may name the bank (docs/spec.md section 3.11).""" + if tx["type"] != "transfer_out" or tx["leg_out_ore"] is None: + return False + sides = (tx["market_id"] == bank_id, tx["to_market_id"] == bank_id) + return sides[0] != sides[1] + + def _write_transaction(conn, tx_id, tx, picks): """Insert or update one row, filling in what the server derives.""" now = _now_stamp()