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};
std::shared_ptr< const CTransaction > CTransactionRef
#define NO_THREAD_SAFETY_ANALYSIS
BENCHMARK(MempoolCheckEphemeralSpends, benchmark::PriorityLevel::HIGH)
Bench & complexityN(T n) noexcept
static void MempoolCheckEphemeralSpends(benchmark::Bench &bench)
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
static void AddTx(const CTransactionRef &tx, CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main
Txid GetHash() const
Compute the hash of this CMutableTransaction.
AddToMempool(pool, CTxMemPoolEntry(tx, fee, nTime, nHeight, sequence, spendsCoinbase, sigOpCost, lp))
std::vector< CTxOut > vout
bool CheckEphemeralSpends(const Package &package, CFeeRate dust_relay_rate, const CTxMemPool &tx_pool, TxValidationState &out_child_state, Wtxid &out_child_wtxid)
Must be called for each transaction(package) if any dust is in the package.
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 ...
Serialized script, used inside transaction inputs and outputs.
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
A mutable version of CTransaction.
Main entry point to nanobench's benchmarking facility.
static constexpr CAmount CENT
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate...
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it...
#define Assert(val)
Identity function.
transaction_identifier represents the two canonical transaction identifier types (txid, wtxid).
static constexpr CAmount COIN
The amount of satoshis in one BTC.