]> Untitled Git - bdk/commit
fix(chain): Correctly handle txs that double spend themselves
author志宇 <hello@evanlinjin.me>
Fri, 28 Mar 2025 06:06:26 +0000 (17:06 +1100)
committer志宇 <hello@evanlinjin.me>
Thu, 17 Apr 2025 05:03:24 +0000 (15:03 +1000)
commit370497c3a9c361e10c8341cbb07210f026cc3e04
tree0025a0a0eafc117f27b45514d033b73386c9a7e3
parentb70758652d1c819c88d92765905d09e26b951ee2
fix(chain): Correctly handle txs that double spend themselves

Detect self-double-spends in `CanonicalIter::mark_canonical`. Disregard
the tx that self-double-spends and all it's attached meta data (such as
timestamps and anchors).

Add new test cases on `test_tx_conflict_handling` for transactions that
self-double-spend.
crates/chain/src/canonical_iter.rs
crates/chain/tests/test_tx_graph_conflicts.rs