mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-02 11:11:04 +02:00
2835216ec09cc2d86b091824376b15601e7c7b8a txgraph: make GroupClusters use partition numbers directly (optimization) (Pieter Wuille) c72c8d5d45d9a87e4cf78e66f9737b9e6f371d2d txgraph: compare sequence numbers instead of Cluster* (bugfix) (Pieter Wuille) Pull request description: Part of cluster mempool: #30289 The implicit transaction ordering for transactions in a TxGraphImpl is defined by: 1. higher chunk feerate first 2. lower Cluster* object pointer first 3. lower position within cluster linearization first. Number (2) is not deterministic, as it intricately depends on the heap allocation algorithm. Fix this by giving each Cluster a unique `uint64_t m_sequence` value, and sorting by those instead. The second commit then uses this new approach to optimize GroupClusters a bit more, avoiding some repeated checks and dereferences, by making a local copy of the involved sequence numbers. Thanks to @dergoegge for pointing this out. ACKs for top commit: instagibbs: reACK 2835216ec09cc2d86b091824376b15601e7c7b8a marcofleon: ACK 2835216ec09cc2d86b091824376b15601e7c7b8a glozow: utACK 2835216ec09cc2d86b091824376b15601e7c7b8a Tree-SHA512: d772a55b9ed620159b934a42a39fca7f900d4aa89c099a280a0c61ea0bd7c4fc39b388281ffc775064ea77b0b17263871b4c9763aa71c710a79287d5eb2cd4b4