Skip to content

Commit

Permalink
Fix issue#1082, testnet difficulty unsigned integer underflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinandresen committed May 25, 2012
1 parent feeb761 commit 248bceb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,12 +865,12 @@ unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBl
// Only change once per interval
if ((pindexLast->nHeight+1) % nInterval != 0)
{
// Special rules for testnet after 15 Feb 2012:
if (fTestNet && pblock->nTime > 1329264000)
// Special difficulty rule for testnet:
if (fTestNet)
{
// If the new block's timestamp is more than 2* 10 minutes
// then allow mining of a min-difficulty block.
if (pblock->nTime - pindexLast->nTime > nTargetSpacing*2)
if (pblock->nTime > pindexLast->nTime + nTargetSpacing*2)
return nProofOfWorkLimit;
else
{
Expand Down

0 comments on commit 248bceb

Please sign in to comment.