Add Google's LevelDB support
[novacoin.git] / src / main.cpp
index dee31c4..e957e63 100644 (file)
@@ -6,6 +6,7 @@
 #include "alert.h"
 #include "checkpoints.h"
 #include "db.h"
+#include "txdb.h"
 #include "net.h"
 #include "init.h"
 #include "ui_interface.h"
@@ -75,6 +76,10 @@ const string strMessageMagic = "NovaCoin Signed Message:\n";
 int64 nTransactionFee = MIN_TX_FEE;
 bool fStakeUsePooledKeys = false;
 
+// Used during database migration.
+bool fDisableSignatureChecking = false;
+
+
 //////////////////////////////////////////////////////////////////////////////
 //
 // dispatching functions
@@ -2094,8 +2099,6 @@ bool CBlock::AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos)
         if (!SetBestChain(txdb, pindexNew))
             return false;
 
-    txdb.Close();
-
     if (pindexNew == pindexBest)
     {
         // Notify UI to display prev block's coinbase if it was ours
@@ -2868,7 +2871,7 @@ void PrintBlockTree()
     }
 }
 
-bool LoadExternalBlockFile(FILE* fileIn)
+bool LoadExternalBlockFile(FILE* fileIn, ExternalBlockFileProgress *progress)
 {
     int64 nStart = GetTimeMillis();
 
@@ -2917,6 +2920,8 @@ bool LoadExternalBlockFile(FILE* fileIn)
                         nPos += 4 + nSize;
                     }
                 }
+                if (progress != NULL)
+                    (*progress)(4 + nSize);
             }
         }
         catch (std::exception &e) {