replace ComputeMinWork with CheckMinWork

This commit is contained in:
jtimon
2014-06-20 20:55:42 +02:00
parent b343c1a1e3
commit 654871d436
4 changed files with 19 additions and 21 deletions

View File

@@ -2410,12 +2410,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex
return state.DoS(100, error("CheckBlockHeader() : block with timestamp before last checkpoint"),
REJECT_CHECKPOINT, "time-too-old");
}
bool fOverflow = false;
uint256 bnNewBlock;
bnNewBlock.SetCompact(block.nBits, NULL, &fOverflow);
uint256 bnRequired;
bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime));
if (fOverflow || bnNewBlock > bnRequired)
if (!CheckMinWork(block.nBits, pcheckpoint->nBits, deltaTime))
{
return state.DoS(100, error("CheckBlockHeader() : block with too little proof-of-work"),
REJECT_INVALID, "bad-diffbits");