]> Untitled Git - bdk/commit
feat(chain)!: make `IndexedTxGraph::apply_block_relevant` more efficient
author志宇 <hello@evanlinjin.me>
Tue, 2 Jan 2024 09:31:34 +0000 (17:31 +0800)
committer志宇 <hello@evanlinjin.me>
Mon, 15 Jan 2024 16:27:02 +0000 (00:27 +0800)
commita7d01dc39acb3ff7f4bc8e237c7862d019a91cd1
treed9179dbc716d2cbedbfde14f219f11714e8588f4
parente0512acf9476fa3fa7da9cc28a222432f974aad5
feat(chain)!: make `IndexedTxGraph::apply_block_relevant` more efficient

Previously, `apply_block_relevant` used `batch_insert_relevant` which
allows inserting non-topologically-ordered transactions. However,
transactions from blocks are always ordered, so we can avoid looping
through block transactions twice (as done in `batch_insert_relevant`).

Additionally, `apply_block_relevant` now takes in a reference to a
`Block` instead of consuming the `Block`. This makes sense as typically
very few of the transactions in the block are inserted.
crates/bdk/src/wallet/mod.rs
crates/bitcoind_rpc/tests/test_emitter.rs
crates/chain/src/indexed_tx_graph.rs