Skip to content

Commit 79d5cb2

Browse files
committed
Verify DB with original default check-level 3
1 parent ed96859 commit 79d5cb2

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/init.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ std::string HelpMessage(HelpMessageMode mode)
442442
strUsage += HelpMessageOpt("-blocksdir=<dir>", _("Specify directory to hold blocks subdirectory for *.dat files (default: <datadir>)"));
443443
strUsage += HelpMessageOpt("-blocknotify=<cmd>", _("Execute command when the best block changes (%s in cmd is replaced by block hash)"));
444444
strUsage += HelpMessageOpt("-checkblocks=<n>", strprintf(_("How many blocks to check at startup (default: %u, 0 = all)"), DEFAULT_CHECKBLOCKS));
445+
strUsage += HelpMessageOpt("-checklevel=<n>", strprintf("How thorough the block verification of -checkblocks is (0-4, default: %u)", DEFAULT_CHECKLEVEL));
446+
445447
strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), PIVX_CONF_FILENAME));
446448
if (mode == HMM_BITCOIND) {
447449
#if !defined(WIN32)
@@ -1666,8 +1668,8 @@ bool AppInitMain()
16661668
}
16671669
}
16681670

1669-
// Zerocoin must check at level 4
1670-
if (!CVerifyDB().VerifyDB(pcoinsdbview, 4, gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS))) {
1671+
if (!CVerifyDB().VerifyDB(pcoinsdbview, gArgs.GetArg("-checklevel", DEFAULT_CHECKLEVEL),
1672+
gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS))) {
16711673
strLoadError = _("Corrupted block database detected");
16721674
fVerifyingBlocks = false;
16731675
break;

src/rpc/blockchain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,8 @@ UniValue verifychain(const JSONRPCRequest& request)
891891

892892
LOCK(cs_main);
893893

894-
int nCheckLevel = 4;
895-
int nCheckDepth = gArgs.GetArg("-checkblocks", 288);
894+
int nCheckLevel = gArgs.GetArg("-checklevel", DEFAULT_CHECKLEVEL);
895+
int nCheckDepth = gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS);
896896
if (request.params.size() > 0)
897897
nCheckDepth = request.params[0].get_int();
898898

src/validation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ static const unsigned int MAX_ZEROCOIN_TX_SIZE = 150000;
7878
static const unsigned int MAX_DISCONNECTED_TX_POOL_SIZE = 20000;
7979
/** Default for -checkblocks */
8080
static const signed int DEFAULT_CHECKBLOCKS = 6;
81+
static const unsigned int DEFAULT_CHECKLEVEL = 3;
8182
/** The maximum size of a blk?????.dat file (since 0.8) */
8283
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB
8384
/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */

0 commit comments

Comments
 (0)