Remove BerkeleyDB support for block index
[novacoin.git] / src / checkpoints.cpp
index 5de09b3..7d6ffcb 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "checkpoints.h"
 
-#include "txdb.h"
+#include "txdb-leveldb.h"
 #include "main.h"
 #include "uint256.h"
 
@@ -169,10 +169,6 @@ namespace Checkpoints
         if (!txdb.TxnCommit())
             return error("WriteSyncCheckpoint(): failed to commit to db sync checkpoint %s", hashCheckpoint.ToString().c_str());
 
-#ifndef USE_LEVELDB
-        txdb.Close();
-#endif
-
         Checkpoints::hashSyncCheckpoint = hashCheckpoint;
         return true;
     }
@@ -203,9 +199,6 @@ namespace Checkpoints
                 }
             }
 
-#ifndef USE_LEVELDB
-            txdb.Close();
-#endif
             if (!WriteSyncCheckpoint(hashPendingCheckpoint))
                 return error("AcceptPendingSyncCheckpoint(): failed to write sync checkpoint %s", hashPendingCheckpoint.ToString().c_str());
             hashPendingCheckpoint = 0;
@@ -291,11 +284,6 @@ namespace Checkpoints
             {
                 return error("ResetSyncCheckpoint: SetBestChain failed for hardened checkpoint %s", hash.ToString().c_str());
             }
-
-#ifndef USE_LEVELDB
-            txdb.Close();
-#endif
-
         }
         else if(!mapBlockIndex.count(hash))
         {
@@ -450,10 +438,6 @@ bool CSyncCheckpoint::ProcessSyncCheckpoint(CNode* pfrom)
         }
     }
 
-#ifndef USE_LEVELDB
-    txdb.Close();
-#endif
-
     if (!Checkpoints::WriteSyncCheckpoint(hashCheckpoint))
         return error("ProcessSyncCheckpoint(): failed to write sync checkpoint %s", hashCheckpoint.ToString().c_str());
     Checkpoints::checkpointMessage = *this;