2 Comments

The "Bitcoin Balances" query only checks WHERE i.spent_tx_id = o.tx_id to discard spent outputs.

Shouldn't it consider i.spent_tx_id = o.tx_id AND o.index = i.spent_output_number ?

The input could be spending another output from the same transaction!

Expand full comment

that's a great point! I've fixed it, thank you for catching my mistake.

Expand full comment