7ca58b3f6b81f22dff97e74e3e44b4e037f401e1 chore(chain): fix typo in method doc comment (Wei Chen)
c846ad84dda49d2c76e44786f59eb20e02b7710f test(chain): `relevant_conflicts` (志宇)
7003ad44be288cda0ce447e3fa99f893ce48332e feat(chain): Txs that conflict with relevant txs are also relevant (志宇)
Pull request description:
## Description
This PR changes the behavior of `IndexedTxGraph` insert-if-relevant methods to consider relevant-tx-conflicts as relevant.
Affected methods:
* `.apply_block_relevant`
* `.batch_insert_relevant`
* `.batch_insert_relevant_unconfirmed`
#### Rationale
It is useful to be able to determine:
* Why something is no longer part of the best history.
* Whether it is possible that something can reappear in the best history.
In order to do this, we need to track conflicts of spk-relevant transactions.
For example, an incoming transaction may be evicted from the mempool due to insufficient fees or cancelled (a conflicting transaction is confirmed). The caller may want to handle these two possibilities differently:
* **Transaction has insufficient fees** - the caller may want to CPFP the transaction.
* **Transaction is cancelled/replaced** - The user may want to forget about this transaction once the conflict reaches x confirmations.
The `IntentTracker` will make use of these relevant-conflicts to help determine the course of action.
#### Side 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.
### Changelog notice
```md
Changed:
- Behavior of `IndexedTxGraph` methods (`apply_block_relevant`, `batch_insert_relevant` and `batch_insert_relevant_unconfirmed`) to also consider conflicts of spk-relevant transactions as relevant.
```
### Checklists
#### All Submissions:
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
#### New Features:
* [x] I've added tests for the new feature
* [x] I've added docs for the new feature
ACKs for top commit:
LagginTimes:
ACK
7ca58b3f6b81f22dff97e74e3e44b4e037f401e1
nymius:
ACK
7ca58b3f6b81f22dff97e74e3e44b4e037f401e1
Tree-SHA512: c5e8d45681ad149d9c963c11b8db7787d03ac1f17aa9cdaca7e1044537127c35bfdb3f6f56169a7a35f64bc9cc7d5a9867a01cdb2f2db8613b1d41ed62917e3b