changeset 2695:02ad24bce194 draft

Fix issue#1082, testnet difficulty unsigned integer underflow
author Gavin Andresen <gavinandresen@gmail.com>
date Fri, 13 Apr 2012 14:38:05 -0400
parents 703d418e4bc6
children c1ff8c7f8893
files src/main.cpp
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -865,12 +865,12 @@
     // 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
             {