PPCoin: Check time as well for checkpoint-too-old safe mode
authorSunny King <sunnyking9999@gmail.com>
Tue, 14 Aug 2012 18:59:17 +0000 (19:59 +0100)
committerSunny King <sunnyking9999@gmail.com>
Tue, 14 Aug 2012 18:59:17 +0000 (19:59 +0100)
src/checkpoints.cpp

index 7174d10..0f6e441 100644 (file)
@@ -348,7 +348,8 @@ namespace Checkpoints
         // sync-checkpoint should always be accepted block
         assert(mapBlockIndex.count(hashSyncCheckpoint));
         const CBlockIndex* pindexSync = mapBlockIndex[hashSyncCheckpoint];
-        return (nBestHeight >= pindexSync->nHeight + COINBASE_MATURITY);
+        return (nBestHeight >= pindexSync->nHeight + COINBASE_MATURITY ||
+                pindexSync->GetBlockTime() + STAKE_MIN_AGE < GetAdjustedTime());
     }
 }