PPCoin: Remove automatic checkpoint code
[novacoin.git] / src / db.cpp
index 89f8b16..e52e6cf 100644 (file)
@@ -470,17 +470,6 @@ bool CTxDB::WriteBestInvalidTrust(uint64 nBestInvalidTrust)
     return Write(string("nBestInvalidTrust"), nBestInvalidTrust);
 }
 
-bool CTxDB::ReadAutoCheckpoint(int& nAutoCheckpoint)
-{
-    return Read(string("nAutoCheckpoint"), nAutoCheckpoint);
-}
-
-bool CTxDB::WriteAutoCheckpoint(int nCheckpoint, bool fReset)
-{
-    nCheckpoint = fReset? nCheckpoint : max(Checkpoints::nAutoCheckpoint, nCheckpoint);
-    return Write(string("nAutoCheckpoint"), nCheckpoint);
-}
-
 bool CTxDB::ReadSyncCheckpoint(uint256& hashCheckpoint)
 {
     return Read(string("hashSyncCheckpoint"), hashCheckpoint);
@@ -550,7 +539,6 @@ bool CTxDB::LoadBlockIndex()
             pindexNew->nBlockPos      = diskindex.nBlockPos;
             pindexNew->nChainTrust    = diskindex.nChainTrust;
             pindexNew->nHeight        = diskindex.nHeight;
-            pindexNew->nCheckpoint    = diskindex.nCheckpoint;
             pindexNew->fProofOfStake  = diskindex.fProofOfStake;
             pindexNew->prevoutStake   = diskindex.prevoutStake;
             pindexNew->nVersion       = diskindex.nVersion;
@@ -591,11 +579,6 @@ bool CTxDB::LoadBlockIndex()
     nBestChainTrust = pindexBest->nChainTrust;
     printf("LoadBlockIndex(): hashBestChain=%s  height=%d  trust=%d\n", hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, nBestChainTrust);
 
-    // ppcoin: load nAutoCheckpoint
-    if (!ReadAutoCheckpoint(Checkpoints::nAutoCheckpoint))
-        return error("CTxDB::LoadBlockIndex() : nAutoCheckpoint not loaded");
-    printf("LoadBlockIndex(): automatic checkpoint at height=%d\n", Checkpoints::nAutoCheckpoint);
-
     // ppcoin: load hashSyncCheckpoint
     if (!ReadSyncCheckpoint(Checkpoints::hashSyncCheckpoint))
         return error("CTxDB::LoadBlockIndex() : hashSyncCheckpoint not loaded");