MCPcopy Create free account
hub / github.com/ElementsProject/elements / CheckBlockHeader

Function CheckBlockHeader

src/validation.cpp:3560–3568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3558}
3559
3560static bool CheckBlockHeader(const CBlockHeader& block, BlockValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true)
3561{
3562 // Check proof of work matches claimed amount
3563 if (fCheckPOW && block.GetHash() != consensusParams.hashGenesisBlock
3564 && !CheckProof(block, consensusParams)) {
3565 return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, g_signed_blocks ? "block-proof-invalid" : "high-hash", "proof of work failed");
3566 }
3567 return true;
3568}
3569
3570bool CheckBlock(const CBlock& block, BlockValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW, bool fCheckMerkleRoot)
3571{

Callers 2

CheckBlockFunction · 0.85
AcceptBlockHeaderMethod · 0.85

Calls 3

CheckProofFunction · 0.85
InvalidMethod · 0.80
GetHashMethod · 0.45

Tested by

no test coverage detected