txgraph: pass fallback_order to TxGraph (preparation)

This adds an std::function<strong_ordering(Ref&,Ref&)> argument to the
MakeTxGraph function, which can be used by the caller (e.g., mempool
code) to provide a fallback order to TxGraph.

This is just preparation; TxGraph does not yet use this fallback order
for anything.
This commit is contained in:
Pieter Wuille
2026-01-08 15:17:28 -05:00
parent 941c432a46
commit fba004a3df
7 changed files with 100 additions and 23 deletions

View File

@@ -9,6 +9,7 @@
#include <uint256.h>
#include <util/types.h>
#include <compare>
#include <cstddef>
#include <optional>
#include <string>
@@ -42,7 +43,7 @@ public:
template <typename Other>
bool operator==(const Other& other) const { return Compare(other) == 0; }
template <typename Other>
bool operator<(const Other& other) const { return Compare(other) < 0; }
std::strong_ordering operator<=>(const Other& other) const { return Compare(other) <=> 0; }
const uint256& ToUint256() const LIFETIMEBOUND { return m_wrapped; }
static transaction_identifier FromUint256(const uint256& id) { return {id}; }