7#include <chainparams.h>
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());
const CChainParams & Params()
Return the currently selected parameters.
std::vector< CTransactionRef > vtx
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 ComputeTotalSize() const
Calculate the total transaction size in bytes, including witness data.
std::string GetRejectReason() const
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)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
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.
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.
std::unique_ptr< T > MakeNoLogFileContext(const ChainType chain_type=ChainType::REGTEST, TestOpts opts={})
Make a test setup that has disk access to the debug.log file disabled.
A mutable version of CTransaction.
std::vector< CTxOut > vout
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.