Decide when the bank may be named
This commit is contained in:
1 parent
c382e3c278
commit
10e93d69a3
1 file changed
+8
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user