MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CheckProofOfWorkImpl

Function CheckProofOfWorkImpl

src/pow.cpp:161–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161bool CheckProofOfWorkImpl(uint256 hash, unsigned int nBits, const Consensus::Params& params)
162{
163 auto bnTarget{DeriveTarget(nBits, params.powLimit)};
164 if (!bnTarget) return false;
165
166 // Check proof of work matches claimed amount
167 if (UintToArith256(hash) > bnTarget)
168 return false;
169
170 return true;
171}

Callers 3

CheckProofOfWorkFunction · 0.85
integer.cppFile · 0.85
pow.cppFile · 0.85

Calls 2

DeriveTargetFunction · 0.85
UintToArith256Function · 0.85

Tested by

no test coverage detected