| 26 | } |
| 27 | |
| 28 | static void RpcMempool(benchmark::Bench& bench) |
| 29 | { |
| 30 | const auto testing_setup = MakeNoLogFileContext<const ChainTestingSetup>(ChainType::MAIN); |
| 31 | CTxMemPool& pool = *Assert(testing_setup->m_node.mempool); |
| 32 | LOCK2(cs_main, pool.cs); |
| 33 | |
| 34 | for (int i = 0; i < 1000; ++i) { |
| 35 | CMutableTransaction tx = CMutableTransaction(); |
| 36 | tx.vin.resize(1); |
| 37 | tx.vin[0].scriptSig = CScript() << OP_1; |
| 38 | tx.vin[0].scriptWitness.stack.push_back({1}); |
| 39 | tx.vout.resize(1); |
| 40 | tx.vout[0].scriptPubKey = CScript() << OP_1 << OP_EQUAL; |
| 41 | tx.vout[0].nValue = i; |
| 42 | const CTransactionRef tx_r{MakeTransactionRef(tx)}; |
| 43 | AddTx(tx_r, /*fee=*/i, pool); |
| 44 | } |
| 45 | |
| 46 | bench.run([&] { |
| 47 | (void)MempoolToJSON(pool, /*verbose=*/true); |
| 48 | }); |
| 49 | } |
| 50 | |
| 51 | BENCHMARK(RpcMempool); |
nothing calls this directly
no test coverage detected