From 8436cffb2342b36997ce263bbc280118b6cf7596 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sun, 15 Nov 2026 10:40:52 +0000 Subject: [PATCH] Let what a transfer sends be exactly what arrives --- app.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index c3d2418..34a7c6b 100644 --- a/app.py +++ b/app.py @@ -217,7 +217,7 @@ def _sync_transfer_pair(conn, tx_id, previous, tx): conn.execute( "UPDATE transactions SET transfer_group = ? WHERE id = ?", (group, tx_id) ) - arrived = (tx["leg_out_sats"] or 0) - (tx["fee_sats"] or 0) + arrived = tx["leg_out_sats"] or 0 now = _now_stamp() row = conn.execute( "SELECT id FROM transactions WHERE type = 'transfer_in' AND transfer_group = ?", @@ -227,17 +227,17 @@ def _sync_transfer_pair(conn, tx_id, previous, tx): conn.execute( "INSERT INTO transactions (date, type, market_id, taxable, note, leg_in_sats," " fee_sats, fee_ore, to_market_id, transfer_group, generated, created_at," - " updated_at) VALUES (?, 'transfer_in', ?, ?, '', ?, ?, ?, ?, ?, 1, ?, ?)", - (tx["date"], tx["to_market_id"], tx["taxable"], arrived, tx["fee_sats"], - tx["fee_ore"], tx["market_id"], group, now, now), + " updated_at) VALUES (?, 'transfer_in', ?, ?, '', ?, 0, 0, ?, ?, 1, ?, ?)", + (tx["date"], tx["to_market_id"], tx["taxable"], arrived, + tx["market_id"], group, now, now), ) else: conn.execute( "UPDATE transactions SET date = ?, market_id = ?, taxable = ?," - " leg_in_sats = ?, fee_sats = ?, fee_ore = ?, to_market_id = ?," + " leg_in_sats = ?, fee_sats = 0, fee_ore = 0, to_market_id = ?," " generated = 1, updated_at = ? WHERE id = ?", - (tx["date"], tx["to_market_id"], tx["taxable"], arrived, tx["fee_sats"], - tx["fee_ore"], tx["market_id"], now, row["id"]), + (tx["date"], tx["to_market_id"], tx["taxable"], arrived, + tx["market_id"], now, row["id"]), ) elif group: _drop_ledger(conn)