From 168ba993921c2c1a21cad1f03a331f7c01c67079 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 19 Jun 2013 11:32:49 -0400 Subject: [PATCH] Pass check level, check depth to VerifyDB() --- src/init.cpp | 3 ++- src/main.cpp | 5 ++--- src/main.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index fe74cd696..ec10e627f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -757,7 +757,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; } diff --git a/src/main.cpp b/src/main.cpp index f0c08d273..58c0c9363 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2616,13 +2616,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) diff --git a/src/main.h b/src/main.h index 87f1dbfa8..19d4a87b3 100644 --- a/src/main.h +++ b/src/main.h @@ -146,7 +146,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 */