Describe the enhancement
The TxGraph::direct_conflicts() method returns a Vec<(usize, Txid)> of conflicting transactions, but there's currently no guaranteed ordering. For downstream libraries like bdk-wallet that need to track transaction replacements (RBF, double-spends), it would be helpful if the ordering was guaranteed such that the last entry is always the most recent/canonical transaction that remains in the mempool.
Use case
When generating wallet events for replaced transactions in bdk-wallet, we need to identify which conflicting transaction actually replaced the original one. I'm currently using bdk-wallet in ldk-node and consuming these events, but without guaranteed ordering from direct_conflicts(), there's no reliable way to determine which conflict is the canonical replacement.
Impact
Are you using BDK in a production project?
Which backend(s) are relevant (if any)?
Project or organization (optional)
Additional context
This came up while implementing wallet events (specifically TxReplaced events) in bdk-wallet. Related PR: lightningdevkit/ldk-node#628
Describe the enhancement
The
TxGraph::direct_conflicts()method returns aVec<(usize, Txid)>of conflicting transactions, but there's currently no guaranteed ordering. For downstream libraries like bdk-wallet that need to track transaction replacements (RBF, double-spends), it would be helpful if the ordering was guaranteed such that the last entry is always the most recent/canonical transaction that remains in the mempool.Use case
When generating wallet events for replaced transactions in bdk-wallet, we need to identify which conflicting transaction actually replaced the original one. I'm currently using bdk-wallet in ldk-node and consuming these events, but without guaranteed ordering from
direct_conflicts(), there's no reliable way to determine which conflict is the canonical replacement.Impact
Are you using BDK in a production project?
Which backend(s) are relevant (if any)?
bdk_chain,bdk_core)____Project or organization (optional)
Additional context
This came up while implementing wallet events (specifically TxReplaced events) in bdk-wallet. Related PR: lightningdevkit/ldk-node#628