Changeset View
Changeset View
Standalone View
Standalone View
src/bench/rpc_mempool.cpp
Show All 9 Lines | |||||
#include <univalue.h> | #include <univalue.h> | ||||
#include <list> | #include <list> | ||||
#include <vector> | #include <vector> | ||||
static void AddTx(const CTransactionRef &tx, const Amount &fee, | static void AddTx(const CTransactionRef &tx, const Amount &fee, | ||||
CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs) { | CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs) { | ||||
LockPoints lp; | LockPoints lp; | ||||
pool.addUnchecked(tx->GetId(), CTxMemPoolEntry(tx, fee, /* time */ 0, | pool.addUnchecked(CTxMemPoolEntry(tx, fee, /* time */ 0, | ||||
/* height */ 1, | /* height */ 1, | ||||
/* spendsCoinbase */ false, | /* spendsCoinbase */ false, | ||||
/* sigOpCount */ 1, lp)); | /* sigOpCount */ 1, lp)); | ||||
} | } | ||||
static void RpcMempool(benchmark::State &state) { | static void RpcMempool(benchmark::State &state) { | ||||
CTxMemPool pool; | CTxMemPool pool; | ||||
LOCK2(cs_main, pool.cs); | LOCK2(cs_main, pool.cs); | ||||
for (int i = 0; i < 1000; ++i) { | for (int i = 0; i < 1000; ++i) { | ||||
CMutableTransaction tx = CMutableTransaction(); | CMutableTransaction tx = CMutableTransaction(); | ||||
Show All 15 Lines |