]> 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>
Wed, 14 Jan 2026 11:27:02 +0000 (19:27 +0800)
commit184db01a38a8970d1628258e22a24941fcbd3a3f
tree213cfe917a3e105e66e246f417ed6901afdf4df8
parenta161ee24d38b038a51161816a9f90a87f90d157d
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/canonical_view.rs
crates/chain/src/chain_data.rs