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()