]> Untitled Git - bdk/commit
fix(tx_graph)!: Change tx_last_seen to `Option<u64>`
authorvalued mammal <valuedmammal@protonmail.com>
Thu, 23 May 2024 21:33:45 +0000 (17:33 -0400)
committervalued mammal <valuedmammal@protonmail.com>
Sun, 30 Jun 2024 14:08:54 +0000 (10:08 -0400)
commitbbc19c3536b25c78be8b5f3fe0cd9810aa679742
tree2a92f8ec6288d3521a6ae076837293d8a549cb78
parent324eeb3eb4e5231c6a81e6d197df788ad08b23a8
fix(tx_graph)!: Change tx_last_seen to `Option<u64>`

Also fixup `test_list_owned_txouts` to check that the right
outputs, utxos, and balance are returned at different local
chain heights.

This fixes an issue where unbroadcast and otherwise non-canonical
transactions were returned from methods `list_chain_txs` and
`Wallet::transactions` because every tx inserted had a last_seen
of 0 making it appear unconfirmed.

Note this commit changes the way `Balance` is represented due to
new logic in `try_get_chain_position` that no longer considers
txs with non-canonical anchors. Before this change, a tx anchored
to a block that is reorged out had a permanent effect on the
pending balance, and now only txs with a last_seen time or an
anchor confirmed in the best chain will return a `ChainPosition`.
crates/bitcoind_rpc/tests/test_emitter.rs
crates/chain/src/tx_graph.rs
crates/chain/tests/common/tx_template.rs
crates/chain/tests/test_indexed_tx_graph.rs
crates/chain/tests/test_tx_graph.rs
crates/electrum/tests/test_electrum.rs
crates/wallet/tests/wallet.rs