| 83 | } |
| 84 | |
| 85 | static void ComplexMemPool(benchmark::Bench& bench) |
| 86 | { |
| 87 | FastRandomContext det_rand{true}; |
| 88 | int childTxs = 800; |
| 89 | if (bench.complexityN() > 1) { |
| 90 | childTxs = static_cast<int>(bench.complexityN()); |
| 91 | } |
| 92 | std::vector<CTransactionRef> ordered_coins = CreateOrderedCoins(det_rand, childTxs, /* min_ancestors */ 1); |
| 93 | const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(CBaseChainParams::MAIN); |
| 94 | CTxMemPool pool; |
| 95 | LOCK2(cs_main, pool.cs); |
| 96 | bench.run([&]() NO_THREAD_SAFETY_ANALYSIS { |
| 97 | for (auto& tx : ordered_coins) { |
| 98 | AddTx(tx, pool); |
| 99 | } |
| 100 | pool.TrimToSize(pool.DynamicMemoryUsage() * 3 / 4); |
| 101 | pool.TrimToSize(GetVirtualTransactionSize(*ordered_coins.front())); |
| 102 | }); |
| 103 | } |
| 104 | |
| 105 | static void MempoolCheck(benchmark::Bench& bench) |
| 106 | { |
nothing calls this directly
no test coverage detected