Part of cluster mempool: #30289
The implicit transaction ordering for transactions in a TxGraphImpl is defined by:
- higher chunk feerate first
- lower Cluster* object pointer first
- 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.