7#include <chainparams.h>
31 const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
42 CBlockIndex* pindexPrev = testing_setup->m_node.chainman->ActiveChain().Tip();
43 assert(pindexPrev !=
nullptr);
49 coinbaseTx.vin.resize(1);
50 coinbaseTx.vin[0].prevout.SetNull();
51 coinbaseTx.vout.resize(1);
52 coinbaseTx.vout[0].scriptPubKey = SCRIPT_PUB;
57 naughtyTx.vout.resize(1);
58 naughtyTx.vout[0].nValue = 0;
59 naughtyTx.vout[0].scriptPubKey = SCRIPT_PUB;
62 for (uint64_t x = 0; x < (n_inputs - 1); ++x) {
65 naughtyTx.vin.emplace_back(naughtyTx.vin.back());
75 assert(cvstate.GetRejectReason() ==
"bad-txns-inputs-duplicate");
const CChainParams & Params()
Return the currently selected parameters.
The block chain is a tree shaped structure starting with the genesis block at the root,...
int nHeight
height of the entry in the chain. The genesis block has height 0
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
const Consensus::Params & GetConsensus() const
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
unsigned int GetTotalSize() const
Get the total transaction size in bytes, including witness data.
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
static transaction_identifier FromUint256(const uint256 &id)
static const unsigned int MAX_BLOCK_SERIALIZED_SIZE
The maximum allowed size for a serialized block, in bytes (only for buffer size limits)
static const int WITNESS_SCALE_FACTOR
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)
unsigned int GetNextWorkRequired(const CBlockIndex *pindexLast, const CBlockHeader *pblock, const Consensus::Params ¶ms)
static CTransactionRef MakeTransactionRef(Tx &&txIn)
uint256 GetRandHash() noexcept
Generate a random uint256.
A mutable version of CTransaction.
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params &consensusParams)
bool CheckBlock(const CBlock &block, BlockValidationState &state, const Consensus::Params &consensusParams, bool fCheckPOW, bool fCheckMerkleRoot)
Functions for validating blocks and updating the block tree.