Browse Source

Pass check level, check depth to VerifyDB()

0.8
Jeff Garzik 11 years ago committed by Warren Togami
parent
commit
e2bc2dff95
  1. 3
      src/init.cpp
  2. 5
      src/main.cpp
  3. 2
      src/main.h

3
src/init.cpp

@ -928,7 +928,8 @@ bool AppInit2(boost::thread_group& threadGroup) @@ -928,7 +928,8 @@ bool AppInit2(boost::thread_group& threadGroup)
}
uiInterface.InitMessage(_("Verifying blocks..."));
if (!VerifyDB()) {
if (!VerifyDB(GetArg("-checklevel", 3),
GetArg( "-checkblocks", 288))) {
strLoadError = _("Corrupted block database detected");
break;
}

5
src/main.cpp

@ -2638,13 +2638,12 @@ bool static LoadBlockIndexDB() @@ -2638,13 +2638,12 @@ bool static LoadBlockIndexDB()
return true;
}
bool VerifyDB() {
bool VerifyDB(int nCheckLevel, int nCheckDepth)
{
if (pindexBest == NULL || pindexBest->pprev == NULL)
return true;
// Verify blocks in the best chain
int nCheckLevel = GetArg("-checklevel", 3);
int nCheckDepth = GetArg( "-checkblocks", 288);
if (nCheckDepth == 0)
nCheckDepth = 1000000000; // suffices until the year 19000
if (nCheckDepth > nBestHeight)

2
src/main.h

@ -143,7 +143,7 @@ bool LoadBlockIndex(); @@ -143,7 +143,7 @@ bool LoadBlockIndex();
/** Unload database information */
void UnloadBlockIndex();
/** Verify consistency of the block and coin databases */
bool VerifyDB();
bool VerifyDB(int nCheckLevel, int nCheckDepth);
/** Print the loaded block tree */
void PrintBlockTree();
/** Find a block by height in the currently-connected chain */

Loading…
Cancel
Save