]> Untitled Git - bdk/commit
[chain_redesign] Change behavior of `try_get_chain_position`
author志宇 <hello@evanlinjin.me>
Wed, 3 May 2023 03:43:16 +0000 (11:43 +0800)
committer志宇 <hello@evanlinjin.me>
Wed, 3 May 2023 03:43:16 +0000 (11:43 +0800)
commite413d3e42455e26de2a079151aab166af71a3c72
tree800ba33ec9009352c2ccf1e40d64675f82b91c45
parentc61995ca971e0d3461d7dc63aec8f1329c625d93
[chain_redesign] Change behavior of `try_get_chain_position`

`TxGraph::try_get_chain_position` used to always exclude unconfirmed
transactions with last_seen value of 0. However, what is the point of
including a transaction in the graph if it cannot be part of the chain
history? Additionally, maybe sometimes we don't wish to use the
last_seen field at all.

The new behavior will consider unconfirmed transactions with last_seen
of 0.
crates/chain/src/tx_graph.rs
crates/chain/tests/test_tx_graph.rs