]> Untitled Git - bdk/commit
fix(chain): correct ChainPosition ordering for wallet transaction display
author志宇 <hello@evanlinjin.me>
Fri, 21 Nov 2025 09:34:29 +0000 (09:34 +0000)
committer志宇 <hello@evanlinjin.me>
Thu, 12 Mar 2026 06:39:13 +0000 (06:39 +0000)
commit9d2dedcd53a7ccde454c84f2c40327ef18603b51
tree355a90510b6cfe6ce4578d2a52223341036e558c
parent2ee48d7b5199d9a4ef8626b2ff87e124f8897604
fix(chain): correct ChainPosition ordering for wallet transaction display

Previously, unconfirmed transactions never seen in mempool would appear
before those with mempool timestamps due to derived Ord implementation.

Changes:
- Manual Ord impl: confirmed < unconfirmed < never-in-mempool
- At same height: transitive confirmations < direct (potentially earlier)
- Simplify FullTxOut ordering to only essential fields
- Add comprehensive tests and documentation
- Update CanonicalTx and FullTxOut to use manual Ord with A: Ord bound
crates/chain/src/chain_data.rs
crates/chain/src/tx_graph.rs