5#include <chainparams.h>
31 }
catch (
const std::ios_base::failure&) {
36 const bool valid_incl_pow_and_merkle =
CheckBlock(block, validation_state_pow_and_merkle, consensus_params,
true,
true);
37 assert(validation_state_pow_and_merkle.
IsValid() || validation_state_pow_and_merkle.
IsInvalid() || validation_state_pow_and_merkle.
IsError());
38 (void)validation_state_pow_and_merkle.
Error(
"");
40 const bool valid_incl_pow =
CheckBlock(block, validation_state_pow, consensus_params,
true,
false);
43 const bool valid_incl_merkle =
CheckBlock(block, validation_state_merkle, consensus_params,
false,
true);
46 const bool valid_incl_none =
CheckBlock(block, validation_state_none, consensus_params,
false,
false);
48 if (valid_incl_pow_and_merkle) {
49 assert(valid_incl_pow && valid_incl_merkle && valid_incl_none);
50 }
else if (valid_incl_merkle || valid_incl_pow) {
56 if (!block.
vtx.empty()) {
63 assert(raw_memory_size_as_shared_ptr > raw_memory_size);
66 const bool is_null = block_copy.
IsNull();
void SelectParams(const ChainType chain)
Sets the params returned by Params() to those for the given chain type.
const CChainParams & Params()
Return the currently selected parameters.
std::string ToString() const
std::vector< CTransactionRef > vtx
const Consensus::Params & GetConsensus() const
Double ended buffer combining vector and stream-like interfaces.
bool Error(const std::string &reject_reason)
static int64_t GetBlockWeight(const CBlock &block)
int GetWitnessCommitmentIndex(const CBlock &block)
Compute at which vout of the block's coinbase transaction the witness commitment occurs,...
static size_t RecursiveDynamicUsage(const CScript &script)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
uint256 BlockWitnessMerkleRoot(const CBlock &block, bool *mutated)
static constexpr TransactionSerParams TX_WITH_WITNESS
Parameters that influence chain consensus.
FUZZ_TARGET(block,.init=initialize_block)
bool CheckBlock(const CBlock &block, BlockValidationState &state, const Consensus::Params &consensusParams, bool fCheckPOW, bool fCheckMerkleRoot)
Functions for validating blocks and updating the block tree.