7 #include <test/util/setup_common.h> 19 tx, nFee, nTime, nHeight,
20 spendsCoinbase, sigOpCost, lp));
28 TestingSetup test_setup{
39 tx1.
vin[0].scriptWitness.stack.push_back({1});
47 tx2.
vin[0].scriptWitness.stack.push_back({2});
56 tx3.
vin[0].scriptWitness.stack.push_back({3});
63 tx4.
vin[0].prevout.SetNull();
65 tx4.
vin[0].scriptWitness.stack.push_back({4});
66 tx4.
vin[1].prevout.SetNull();
68 tx4.
vin[1].scriptWitness.stack.push_back({4});
79 tx5.
vin[0].scriptWitness.stack.push_back({4});
80 tx5.
vin[1].prevout.SetNull();
82 tx5.
vin[1].scriptWitness.stack.push_back({5});
93 tx6.
vin[0].scriptWitness.stack.push_back({4});
94 tx6.
vin[1].prevout.SetNull();
96 tx6.
vin[1].scriptWitness.stack.push_back({6});
107 tx7.
vin[0].scriptWitness.stack.push_back({5});
110 tx7.
vin[1].scriptWitness.stack.push_back({6});
129 AddTx(tx1_r, 10000LL, pool);
130 AddTx(tx2_r, 5000LL, pool);
131 AddTx(tx3_r, 20000LL, pool);
132 AddTx(tx4_r, 7000LL, pool);
133 AddTx(tx5_r, 1000LL, pool);
134 AddTx(tx6_r, 1100LL, pool);
135 AddTx(tx7_r, 9000LL, pool);
std::shared_ptr< const CTransaction > CTransactionRef
#define NO_THREAD_SAFETY_ANALYSIS
static void AddTx(const CTransactionRef &tx, const CAmount &nFee, CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main
static void MempoolEviction(benchmark::Bench &bench)
static const std::string REGTEST
size_t DynamicMemoryUsage() const
static const CAmount COIN
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
int64_t CAmount
Amount in satoshis (Can be negative)
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate...
An outpoint - a combination of a transaction hash and an index n into its vout.
std::vector< CTxOut > vout
BENCHMARK(MempoolEviction)
static CTransactionRef MakeTransactionRef(Tx &&txIn)
#define EXCLUSIVE_LOCKS_REQUIRED(...)
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
Serialized script, used inside transaction inputs and outputs.
A mutable version of CTransaction.
void TrimToSize(size_t sizelimit, std::vector< COutPoint > *pvNoSpendsRemaining=nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs)
Remove transactions from the mempool until its dynamic size is <= sizelimit.
Main entry point to nanobench's benchmarking facility.
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it...