![]() |
Bitcoin Core 31.0.0
P2P Digital Currency
|
#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.
Classes | |
| struct | ReorgTxns |
| Reorg where 1 block is disconnected and 2 blocks are connected. More... | |
Typedefs | |
| using | BlockTxns = decltype(CBlock::vtx) |
Variables | |
| constexpr size_t | BLOCK_VTX_COUNT {4000} |
| constexpr size_t | BLOCK_VTX_COUNT_10PERCENT {400} |
Definition at line 23 of file disconnected_transactions.cpp.
|
static |
Add transactions from DisconnectedBlockTransactions, remove 10% of them, and then pop from the front until empty.
Definition at line 127 of file disconnected_transactions.cpp.
|
static |
Add transactions from DisconnectedBlockTransactions, remove 90% of them, and then pop from the front until empty.
Definition at line 116 of file disconnected_transactions.cpp.
|
static |
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 | ( | AddAndRemoveDisconnectedBlockTransactions10 | ) |
| BENCHMARK | ( | AddAndRemoveDisconnectedBlockTransactions90 | ) |
| BENCHMARK | ( | AddAndRemoveDisconnectedBlockTransactionsAll | ) |
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.
Definition at line 37 of file disconnected_transactions.cpp.
Definition at line 83 of file disconnected_transactions.cpp.
Definition at line 20 of file disconnected_transactions.cpp.
Definition at line 21 of file disconnected_transactions.cpp.