MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / MempoolCheck

Function MempoolCheck

src/bench/mempool_stress.cpp:196–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194
195
196static void MempoolCheck(benchmark::Bench& bench)
197{
198 FastRandomContext det_rand{true};
199 auto testing_setup = MakeNoLogFileContext<TestChain100Setup>(ChainType::REGTEST, {.extra_args = {"-checkmempool=1"}});
200 CTxMemPool& pool = *testing_setup.get()->m_node.mempool;
201 LOCK2(cs_main, pool.cs);
202 testing_setup->PopulateMempool(det_rand, 400, true);
203 const CCoinsViewCache& coins_tip = testing_setup.get()->m_node.chainman->ActiveChainstate().CoinsTip();
204
205 bench.run([&]() NO_THREAD_SAFETY_ANALYSIS {
206 // Bump up the spendheight so we don't hit premature coinbase spend errors.
207 pool.check(coins_tip, /*spendheight=*/300);
208 });
209}
210
211BENCHMARK(MemPoolAncestorsDescendants);
212BENCHMARK(MemPoolAddTransactions);

Callers

nothing calls this directly

Calls 4

PopulateMempoolMethod · 0.80
getMethod · 0.45
runMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected