mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
Merge pull request #2778 from jgarzik/rpc-verifydb
RPC: add 'verifychain' to verify chain database at runtime
This commit is contained in:
@@ -2686,14 +2686,13 @@ 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)
|
||||
if (nCheckDepth <= 0)
|
||||
nCheckDepth = 1000000000; // suffices until the year 19000
|
||||
if (nCheckDepth > nBestHeight)
|
||||
nCheckDepth = nBestHeight;
|
||||
|
||||
Reference in New Issue
Block a user