10 #include <test/util/setup_common.h> 17 TestingSetup test_setup{
35 assert(pindexPrev !=
nullptr);
41 coinbaseTx.vin.resize(1);
42 coinbaseTx.vin[0].prevout.SetNull();
43 coinbaseTx.vout.resize(1);
44 coinbaseTx.vout[0].scriptPubKey = SCRIPT_PUB;
49 naughtyTx.vout.resize(1);
50 naughtyTx.vout[0].nValue = 0;
51 naughtyTx.vout[0].scriptPubKey = SCRIPT_PUB;
54 for (uint64_t x = 0; x < (n_inputs - 1); ++x) {
57 naughtyTx.vin.emplace_back(naughtyTx.vin.back());
67 assert(cvstate.GetRejectReason() ==
"bad-txns-inputs-duplicate");
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params &consensusParams)
static const int WITNESS_SCALE_FACTOR
static const std::string REGTEST
CChain & ChainActive()
Please prefer the identical ChainstateManager::ActiveChain.
uint256 GetRandHash() noexcept
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
unsigned int GetNextWorkRequired(const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params ¶ms)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate...
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
bool CheckBlock(const CBlock &block, BlockValidationState &state, const Consensus::Params &consensusParams, bool fCheckPOW, bool fCheckMerkleRoot)
Functions for validating blocks and updating the block tree.
static CTransactionRef MakeTransactionRef(Tx &&txIn)
The block chain is a tree shaped structure starting with the genesis block at the root...
const CChainParams & Params()
Return the currently selected parameters.
Serialized script, used inside transaction inputs and outputs.
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or nullptr if none.
A mutable version of CTransaction.
unsigned int GetTotalSize() const
Get the total transaction size in bytes, including witness data.
Main entry point to nanobench's benchmarking facility.
static const unsigned int MAX_BLOCK_SERIALIZED_SIZE
The maximum allowed size for a serialized block, in bytes (only for buffer size limits) ...
The basic transaction that is broadcasted on the network and contained in blocks. ...
int nHeight
height of the entry in the chain. The genesis block has height 0
const Consensus::Params & GetConsensus() const