35 }
catch (
const std::ios_base::failure&) {
40 const bool valid_incl_pow_and_merkle =
CheckBlock(block, validation_state_pow_and_merkle, consensus_params,
true,
true);
41 assert(validation_state_pow_and_merkle.
IsValid() || validation_state_pow_and_merkle.
IsInvalid() || validation_state_pow_and_merkle.
IsError());
42 (void)validation_state_pow_and_merkle.
Error(
"");
44 const bool valid_incl_pow =
CheckBlock(block, validation_state_pow, consensus_params,
true,
false);
47 const bool valid_incl_merkle =
CheckBlock(block, validation_state_merkle, consensus_params,
false,
true);
50 const bool valid_incl_none =
CheckBlock(block, validation_state_none, consensus_params,
false,
false);
52 if (valid_incl_pow_and_merkle) {
53 assert(valid_incl_pow && valid_incl_merkle && valid_incl_none);
54 }
else if (valid_incl_merkle || valid_incl_pow) {
60 if (!block.
vtx.empty()) {
69 assert(raw_memory_size_as_shared_ptr > raw_memory_size);
72 const bool is_null = block_copy.
IsNull();
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given chain name.
const CChainParams & Params()
Return the currently selected parameters.
static const std::string REGTEST
std::string ToString() const
std::vector< CTransactionRef > vtx
const Consensus::Params & GetConsensus() const
Double ended buffer combining vector and stream-like interfaces.
Users of this module must hold an ECCVerifyHandle.
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)
Parameters that influence chain consensus.
FUZZ_TARGET_INIT(block, 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.
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation