MCPcopy Create free account
hub / github.com/LUX-Core/lux / CheckProof

Function CheckProof

src/chainparams.cpp:31–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29#include "chainparamsseeds.h"
30
31bool CheckProof(uint256 hash, unsigned int nBits)
32{
33 bool fNegative;
34 bool fOverflow;
35 uint256 bnTarget;
36
37
38 bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
39
40 // Check range
41 if (fNegative || bnTarget == 0 || fOverflow)
42 return false; //error("CheckProofOfWork() : nBits below minimum work");
43
44 // Check proof of work matches claimed amount
45 if (hash > bnTarget)
46 return false; //error("CheckProofOfWork() : hash doesn't match nBits");
47
48 return true;
49}
50
51/**
52 * Main network

Callers 1

GenBlockStakeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected