39 const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
41 int number_outputs{1000};
43 number_outputs =
static_cast<int>(bench.
complexityN());
49 tx1.
vout.resize(number_outputs);
50 for (
size_t i = 0; i < tx1.
vout.size(); i++) {
56 const auto& parent_txid = tx1.
GetHash();
60 tx2.
vin.resize(tx1.
vout.size());
61 for (
size_t i = 0; i < tx2.
vin.size(); i++) {
62 tx2.
vin[0].prevout.hash = parent_txid;
63 tx2.
vin[0].prevout.n = i;
75 uint32_t iteration{0};
static constexpr CAmount COIN
The amount of satoshis in one BTC.
#define Assert(val)
Identity function.
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
Serialized script, used inside transaction inputs and outputs.
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it.
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Bench & complexityN(T n) noexcept
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
bool CheckEphemeralSpends(const Package &package, CFeeRate dust_relay_rate, const CTxMemPool &tx_pool, TxValidationState &out_child_state, Txid &out_child_txid)
Must be called for each transaction(package) if any dust is in the package.
static void AddTx(const CTransactionRef &tx, CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main
AddToMempool(pool, CTxMemPoolEntry(tx, fee, nTime, nHeight, sequence, spendsCoinbase, sigOpCost, lp))
static void MempoolCheckEphemeralSpends(benchmark::Bench &bench)
BENCHMARK(MempoolCheckEphemeralSpends, benchmark::PriorityLevel::HIGH)
static CTransactionRef MakeTransactionRef(Tx &&txIn)
std::shared_ptr< const CTransaction > CTransactionRef
static constexpr CAmount CENT
A mutable version of CTransaction.
std::vector< CTxOut > vout
Txid GetHash() const
Compute the hash of this CMutableTransaction.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
#define NO_THREAD_SAFETY_ANALYSIS