Consensus: Decouple pow.cpp from util.h

This commit is contained in:
Jorge Timón
2015-12-02 03:15:42 +01:00
committed by lateminer
parent 2a758e6810
commit 37ec55836a

View File

@@ -90,11 +90,11 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params&
// Check range
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
return error("CheckProofOfWork(): nBits below minimum work");
return false;
// Check proof of work matches claimed amount
if (UintToArith256(hash) > bnTarget)
return error("CheckProofOfWork(): hash doesn't match nBits");
return false;
return true;
}