mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 13:32:47 +01:00
Pass check level, check depth to VerifyDB()
This commit is contained in:
parent
25dbb92860
commit
168ba99392
@ -757,7 +757,8 @@ bool AppInit2(boost::thread_group& threadGroup)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uiInterface.InitMessage(_("Verifying blocks..."));
|
uiInterface.InitMessage(_("Verifying blocks..."));
|
||||||
if (!VerifyDB()) {
|
if (!VerifyDB(GetArg("-checklevel", 3),
|
||||||
|
GetArg( "-checkblocks", 288))) {
|
||||||
strLoadError = _("Corrupted block database detected");
|
strLoadError = _("Corrupted block database detected");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2616,13 +2616,12 @@ bool static LoadBlockIndexDB()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VerifyDB() {
|
bool VerifyDB(int nCheckLevel, int nCheckDepth)
|
||||||
|
{
|
||||||
if (pindexBest == NULL || pindexBest->pprev == NULL)
|
if (pindexBest == NULL || pindexBest->pprev == NULL)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Verify blocks in the best chain
|
// Verify blocks in the best chain
|
||||||
int nCheckLevel = GetArg("-checklevel", 3);
|
|
||||||
int nCheckDepth = GetArg( "-checkblocks", 288);
|
|
||||||
if (nCheckDepth == 0)
|
if (nCheckDepth == 0)
|
||||||
nCheckDepth = 1000000000; // suffices until the year 19000
|
nCheckDepth = 1000000000; // suffices until the year 19000
|
||||||
if (nCheckDepth > nBestHeight)
|
if (nCheckDepth > nBestHeight)
|
||||||
|
@ -146,7 +146,7 @@ bool LoadBlockIndex();
|
|||||||
/** Unload database information */
|
/** Unload database information */
|
||||||
void UnloadBlockIndex();
|
void UnloadBlockIndex();
|
||||||
/** Verify consistency of the block and coin databases */
|
/** Verify consistency of the block and coin databases */
|
||||||
bool VerifyDB();
|
bool VerifyDB(int nCheckLevel, int nCheckDepth);
|
||||||
/** Print the loaded block tree */
|
/** Print the loaded block tree */
|
||||||
void PrintBlockTree();
|
void PrintBlockTree();
|
||||||
/** Find a block by height in the currently-connected chain */
|
/** Find a block by height in the currently-connected chain */
|
||||||
|
Loading…
Reference in New Issue
Block a user