mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-16 08:54:19 +02:00
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:
@@ -12,6 +12,11 @@
|
||||
|
||||
namespace {
|
||||
|
||||
std::strong_ordering PointerComparator(const TxGraph::Ref& a, const TxGraph::Ref& b) noexcept
|
||||
{
|
||||
return (&a) <=> (&b);
|
||||
}
|
||||
|
||||
void BenchTxGraphTrim(benchmark::Bench& bench)
|
||||
{
|
||||
// The from-block transactions consist of 1000 fully linear clusters, each with 64
|
||||
@@ -60,7 +65,7 @@ void BenchTxGraphTrim(benchmark::Bench& bench)
|
||||
std::vector<size_t> top_components;
|
||||
|
||||
InsecureRandomContext rng(11);
|
||||
auto graph = MakeTxGraph(MAX_CLUSTER_COUNT, MAX_CLUSTER_SIZE, NUM_ACCEPTABLE_ITERS);
|
||||
auto graph = MakeTxGraph(MAX_CLUSTER_COUNT, MAX_CLUSTER_SIZE, NUM_ACCEPTABLE_ITERS, PointerComparator);
|
||||
|
||||
// Construct the top chains.
|
||||
for (int chain = 0; chain < NUM_TOP_CHAINS; ++chain) {
|
||||
|
||||
Reference in New Issue
Block a user