| 17 | } |
| 18 | |
| 19 | static void RpcMempool(benchmark::Bench& bench) |
| 20 | { |
| 21 | CTxMemPool pool; |
| 22 | LOCK2(cs_main, pool.cs); |
| 23 | |
| 24 | for (int i = 0; i < 1000; ++i) { |
| 25 | CMutableTransaction tx = CMutableTransaction(); |
| 26 | tx.vin.resize(1); |
| 27 | tx.vin[0].scriptSig = CScript() << OP_1; |
| 28 | tx.witness.vtxinwit.resize(1); |
| 29 | tx.witness.vtxinwit[0].scriptWitness.stack.push_back({1}); |
| 30 | tx.vout.resize(1); |
| 31 | tx.vout[0].scriptPubKey = CScript() << OP_1 << OP_EQUAL; |
| 32 | tx.vout[0].nValue = i; |
| 33 | const CTransactionRef tx_r{MakeTransactionRef(tx)}; |
| 34 | AddTx(tx_r, /* fee */ i, pool); |
| 35 | } |
| 36 | |
| 37 | bench.run([&] { |
| 38 | (void)MempoolToJSON(pool, /*verbose*/ true); |
| 39 | }); |
| 40 | } |
| 41 | |
| 42 | BENCHMARK(RpcMempool); |
nothing calls this directly
no test coverage detected