34 txns.reserve(num_txns);
37 for (uint32_t i = 0; i < num_txns; ++i) {
42 txns.emplace_back(ptx);
43 prevout_hash = ptx->GetHash();
60 std::copy(shared_txns.begin(), shared_txns.end(), std::back_inserter(disconnected_block_txns));
63 std::copy(shared_txns.begin(), shared_txns.end(), std::back_inserter(connected_block_txns));
78 const auto evicted = disconnectpool.AddTransactionsFromBlock(reorg.
disconnected_txns);
89 disconnectpool.clear();
static void AddAndRemoveDisconnectedBlockTransactions10(benchmark::Bench &bench)
Add transactions from DisconnectedBlockTransactions, remove 10% of them, and then pop from the front ...
constexpr size_t BLOCK_VTX_COUNT
BlockTxns connected_txns_2
Second connected block, new chain tip.
static void Reorg(const ReorgTxns &reorg)
BlockTxns connected_txns_1
First connected block.
size_t num_shared
Transactions shared between disconnected_txns and connected_txns_1.
static void AddAndRemoveDisconnectedBlockTransactionsAll(benchmark::Bench &bench)
Add transactions from DisconnectedBlockTransactions, remove all but one (the disconnected block's coi...
ANKERL_NANOBENCH(NODISCARD) std Bench & minEpochIterations(uint64_t numIters) noexcept
Sets the minimum number of iterations each epoch should take.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
static const uint256 ZERO
An outpoint - a combination of a transaction hash and an index n into its vout.
std::vector< CTxOut > vout
DisconnectedBlockTransactions.
static CTransactionRef MakeTransactionRef(Tx &&txIn)
static ReorgTxns CreateBlocks(size_t num_not_shared)
Creates blocks for a Reorg, each with BLOCK_VTX_COUNT transactions.
std::vector< CTransactionRef > vtx
Reorg where 1 block is disconnected and 2 blocks are connected.
BlockTxns disconnected_txns
Disconnected block.
Serialized script, used inside transaction inputs and outputs.
BENCHMARK(AddAndRemoveDisconnectedBlockTransactionsAll, benchmark::PriorityLevel::HIGH)
decltype(CBlock::vtx) BlockTxns
A mutable version of CTransaction.
Main entry point to nanobench's benchmarking facility.
static constexpr CAmount CENT
constexpr size_t BLOCK_VTX_COUNT_10PERCENT
static void AddAndRemoveDisconnectedBlockTransactions90(benchmark::Bench &bench)
Add transactions from DisconnectedBlockTransactions, remove 90% of them, and then pop from the front ...
static const unsigned int MAX_DISCONNECTED_TX_POOL_SIZE
Maximum kilobytes for transactions to store for processing during reorg.
static BlockTxns CreateRandomTransactions(size_t num_txns)