File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 6
6
#include < policy/policy.h>
7
7
#include < test/util/setup_common.h>
8
8
#include < txmempool.h>
9
+ #include < validation.h>
9
10
10
11
#include < vector>
11
12
@@ -98,4 +99,20 @@ static void ComplexMemPool(benchmark::Bench& bench)
98
99
});
99
100
}
100
101
102
+ static void MempoolCheck (benchmark::Bench& bench)
103
+ {
104
+ FastRandomContext det_rand{true };
105
+ const int childTxs = bench.complexityN () > 1 ? static_cast <int >(bench.complexityN ()) : 2000 ;
106
+ const std::vector<CTransactionRef> ordered_coins = CreateOrderedCoins (det_rand, childTxs, /* min_ancestors */ 5 );
107
+ const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(CBaseChainParams::MAIN, {" -checkmempool=1" });
108
+ CTxMemPool pool;
109
+ LOCK2 (cs_main, pool.cs );
110
+ for (auto & tx : ordered_coins) AddTx (tx, pool);
111
+
112
+ bench.run ([&]() NO_THREAD_SAFETY_ANALYSIS {
113
+ pool.check (testing_setup.get ()->m_node .chainman ->ActiveChainstate ());
114
+ });
115
+ }
116
+
101
117
BENCHMARK (ComplexMemPool);
118
+ BENCHMARK (MempoolCheck);
You can’t perform that action at this time.
0 commit comments