Changeset View
Changeset View
Standalone View
Standalone View
src/bench/block_assemble.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | static void AssembleBlock(benchmark::Bench &bench) { | ||||
} | } | ||||
{ | { | ||||
// Required for ::AcceptToMemoryPool. | // Required for ::AcceptToMemoryPool. | ||||
LOCK(::cs_main); | LOCK(::cs_main); | ||||
for (const auto &txr : txs) { | for (const auto &txr : txs) { | ||||
TxValidationState vstate; | TxValidationState vstate; | ||||
bool ret{::AcceptToMemoryPool(::ChainstateActive(), config, | bool ret{::AcceptToMemoryPool( | ||||
*test_setup.m_node.mempool, vstate, | test_setup.m_node.chainman->ActiveChainstate(), config, | ||||
txr, false /* bypass_limits */)}; | *test_setup.m_node.mempool, vstate, txr, | ||||
false /* bypass_limits */)}; | |||||
assert(ret); | assert(ret); | ||||
} | } | ||||
} | } | ||||
bench.run([&] { PrepareBlock(config, test_setup.m_node, SCRIPT_PUB); }); | bench.run([&] { PrepareBlock(config, test_setup.m_node, SCRIPT_PUB); }); | ||||
} | } | ||||
BENCHMARK(AssembleBlock); | BENCHMARK(AssembleBlock); |