Merge pull request #4377

654871d replace ComputeMinWork with CheckMinWork (jtimon)
b343c1a Move CBlockIndex::GetBlockWork() to pow::GetProofIncrement(nBits) (jtimon)
c2c02f3 Move UpdateTime to pow (jtimon)
This commit is contained in:
Pieter Wuille
2014-08-27 22:35:14 +02:00
7 changed files with 53 additions and 65 deletions

View File

@@ -107,11 +107,7 @@ static bool CheckNBits(unsigned int nbits1, int64_t time1, unsigned int nbits2,
return CheckNBits(nbits2, time2, nbits1, time1);
int64_t deltaTime = time2-time1;
uint256 required;
required.SetCompact(ComputeMinWork(nbits1, deltaTime));
uint256 have;
have.SetCompact(nbits2);
return (have <= required);
return CheckMinWork(nbits2, nbits1, deltaTime);
}
BOOST_AUTO_TEST_CASE(DoS_checknbits)