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

Function CheckChallenge

src/block_proof.cpp:13–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <script/generic.hpp>
12
13bool CheckChallenge(const CBlockHeader& block, const CBlockIndex& indexLast, const Consensus::Params& params)
14{
15 if (g_signed_blocks) {
16 return block.proof.challenge == indexLast.get_proof().challenge;
17 } else {
18 return block.nBits == GetNextWorkRequired(&indexLast, &block, params);
19 }
20}
21
22static bool CheckProofGeneric(const CBlockHeader& block, const uint32_t max_block_signature_size, const CScript& challenge, const CScript& scriptSig, const CScriptWitness& witness)
23{

Callers 1

EXCLUSIVE_LOCKS_REQUIREDFunction · 0.85

Calls 1

GetNextWorkRequiredFunction · 0.85

Tested by

no test coverage detected