#include <bench/bench.h>
#include <kernel/disconnected_transactions.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <script/script.h>
#include <test/util/setup_common.h>
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <memory>
#include <vector>
Go to the source code of this file.
|
| struct | ReorgTxns |
| | Reorg where 1 block is disconnected and 2 blocks are connected. More...
|
◆ BlockTxns
◆ AddAndRemoveDisconnectedBlockTransactions10()
◆ AddAndRemoveDisconnectedBlockTransactions90()
◆ AddAndRemoveDisconnectedBlockTransactionsAll()
Add transactions from DisconnectedBlockTransactions, remove all but one (the disconnected block's coinbase transaction) of them, and then pop from the front until empty.
This is a reorg in which all of the non-coinbase transactions in the disconnected chain also exist in the new chain.
Definition at line 105 of file disconnected_transactions.cpp.
◆ BENCHMARK() [1/3]
◆ BENCHMARK() [2/3]
◆ BENCHMARK() [3/3]
◆ CreateBlocks()
| ReorgTxns CreateBlocks |
( |
size_t | num_not_shared | ) |
|
|
static |
Creates blocks for a Reorg, each with BLOCK_VTX_COUNT transactions.
Between the disconnected block and the first connected block, there will be num_not_shared transactions that are different, and all other transactions the exact same. The second connected block has all unique transactions. This is to simulate a reorg in which all but num_not_shared transactions are confirmed in the new chain.
Definition at line 62 of file disconnected_transactions.cpp.
◆ CreateRandomTransactions()
| BlockTxns CreateRandomTransactions |
( |
size_t | num_txns | ) |
|
|
static |
◆ Reorg()
◆ BLOCK_VTX_COUNT
| size_t BLOCK_VTX_COUNT {4000} |
|
constexpr |
◆ BLOCK_VTX_COUNT_10PERCENT
| size_t BLOCK_VTX_COUNT_10PERCENT {400} |
|
constexpr |