]> Untitled Git - bdk/commit
feat(chain): Txs that conflict with relevant txs are also relevant
author志宇 <hello@evanlinjin.me>
Sat, 2 Aug 2025 06:16:26 +0000 (06:16 +0000)
committer志宇 <hello@evanlinjin.me>
Sat, 2 Aug 2025 06:16:26 +0000 (06:16 +0000)
commit7003ad44be288cda0ce447e3fa99f893ce48332e
tree7d1ec489b43f614a7e67130619772e351018e9f5
parentdcf88607ac0c52fc2928ad55f7b95c3fe99ce423
feat(chain): Txs that conflict with relevant txs are also relevant

Change behavior of {insert|apply}-if-relevant methods of `IndexedTxGraph`
to also consider txs that conflict with relevant txs as relevant.

Rationale:

It is useful to determine why something is evicted from the mempool.

For example, an incoming transaction may be evicted from the mempool due
to insufficient fees or a conflicting transaction is confirmed.

* Insufficient fees - the user may want to CPFP the tx.
* Conflicting tx is confirmed - the sender probably purposefully
  cancelled the tx. The user may want to forget about this tx once it
  reaches x confirmations.

The `IntentTracker` will make use of these relevant-conflicts.

A note about chain sources:

For some chain sources, obtaining relevant-conflicts is extremely
costly or downright impossible (i.e. Electrum, BIP-158 filters).

`bdk_bitcoind_rpc::Emitter` is still the most robust chain source to use.
crates/chain/src/indexed_tx_graph.rs