From b9f1ddf7661a0574d9414d174c6ab95c91758090 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com> Date: Fri, 3 Jun 2022 20:56:15 +0530 Subject: [PATCH] merge bitcoin#18575: Remove requirement that all benches use same testing setup --- src/bench/bench.cpp | 5 ----- src/bench/block_assemble.cpp | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp index 8f26d92d51..c168b1c481 100644 --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -53,11 +53,6 @@ void benchmark::BenchRunner::RunAll(const Args& args) std::vector benchmarkResults; for (const auto& p : benchmarks()) { - RegTestingSetup test{}; - { - assert(::ChainActive().Height() == 0); - } - if (!std::regex_match(p.first, baseMatch, reFilter)) { continue; } diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index 1c48c16bef..222f57c8c2 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -41,7 +41,7 @@ static void AssembleBlock(benchmark::Bench& bench) for (const auto& txr : txs) { CValidationState state; - bool ret{::AcceptToMemoryPool(::mempool, state, txr, nullptr /* pfMissingInputs */, false /* bypass_limits */, /* nAbsurdFee */ 0)}; + bool ret{::AcceptToMemoryPool(*test_setup.m_node.mempool, state, txr, nullptr /* pfMissingInputs */, false /* bypass_limits */, /* nAbsurdFee */ 0)}; assert(ret); } }