 |
Bitcoin Core
21.99.0
P2P Digital Currency
|
Go to the documentation of this file.
8 #include <test/util/mining.h>
9 #include <test/util/setup_common.h>
10 #include <test/util/wallet.h>
19 const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
21 const std::vector<unsigned char> op_true{
OP_TRUE};
23 witness.
stack.push_back(op_true);
31 constexpr
size_t NUM_BLOCKS{200};
33 for (
size_t b{0}; b < NUM_BLOCKS; ++b) {
35 tx.
vin.push_back(MineBlock(test_setup->m_node, SCRIPT_PUB));
36 tx.
vin.back().scriptWitness = witness;
37 tx.
vout.emplace_back(1337, SCRIPT_PUB);
44 for (
const auto& txr : txs) {
51 PrepareBlock(test_setup->m_node, SCRIPT_PUB);
CSHA256 & Write(const unsigned char *data, size_t len)
static const int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule)
MempoolAcceptResult AcceptToMemoryPool(CChainState &active_chainstate, CTxMemPool &pool, const CTransactionRef &tx, bool bypass_limits, bool test_accept)
(Try to) add a transaction to the memory pool.
Main entry point to nanobench's benchmarking facility.
static CTransactionRef MakeTransactionRef(Tx &&txIn)
std::shared_ptr< const CTransaction > CTransactionRef
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
CChainState & ChainstateActive()
Please prefer the identical ChainstateManager::ActiveChainstate.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
void Finalize(unsigned char hash[OUTPUT_SIZE])
Serialized script, used inside transaction inputs and outputs.
std::vector< CTxOut > vout
Validation result for a single transaction mempool acceptance.
A hasher class for SHA-256.
static void AssembleBlock(benchmark::Bench &bench)
A mutable version of CTransaction.
assert(std::addressof(::ChainstateActive().CoinsTip())==std::addressof(coins_cache))
std::vector< std::vector< unsigned char > > stack