mirror of
https://github.com/Such-Software/smirk-backend-core.git
synced 2026-10-17 15:31:38 +02:00
Electrum's get_history is txid, height and fee, and we passed exactly that through. The wallet read total_received and total_sent off those rows, got undefined for both, defaulted them to zero, and rendered every Bitcoin and Litecoin row as a confident "sent 0". Silent, so it read as an empty wallet rather than as a bug. The amounts come from the verbose transaction, and the exactness helpers this needed already existed on VerboseTransaction and simply had no caller: total_received_at is unambiguous from the outputs, and total_sent_from answers only when the server resolved EVERY input's prevout, so a server that resolves none leaves the sent side unknown rather than reporting a partial figure that looks exact. Best effort throughout. A transaction that cannot be fetched keeps null, not zero, because the client distinguishes "not determined" from "nothing moved" and one slow upstream must not fail the whole history request. Resolution is bounded to the newest rows: each one costs a transaction fetch, so an unbounded history would turn a single request into hundreds. Rows past the bound arrive without amounts and say so. The multi-address path resolves each distinct txid once and computes against the whole address set, so a transfer between two of the user's own addresses nets out instead of reading as a payment to a stranger. openapi.json is regenerated, not edited.
168 KiB
168 KiB