aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-09-01 09:41:50 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-09-01 09:42:10 +0200
commit93f97aab629d6d3b7e2c296b24fc37eef9502cd1 (patch)
tree4bd4c5a554e3edf2e579cd3fbd43cf6697a830d8 /src
parent9f3d47677973cb894fdbb437b9b322e2062a1bf1 (diff)
parent2e280311b87ac95a765edd3cac05096e48c73545 (diff)
downloadbitcoin-93f97aab629d6d3b7e2c296b24fc37eef9502cd1.tar.xz
Merge pull request #4768
2e28031 Perform CVerifyDB on pcoinsdbview instead of pcoinsTip (Wladimir J. van der Laan)
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp2
-rw-r--r--src/main.cpp4
-rw-r--r--src/main.h2
-rw-r--r--src/rpcblockchain.cpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 50ad2785dd..b8988f8b75 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -978,7 +978,7 @@ bool AppInit2(boost::thread_group& threadGroup)
}
uiInterface.InitMessage(_("Verifying blocks..."));
- if (!CVerifyDB().VerifyDB(GetArg("-checklevel", 3),
+ if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3),
GetArg("-checkblocks", 288))) {
strLoadError = _("Corrupted block database detected");
break;
diff --git a/src/main.cpp b/src/main.cpp
index da00b4b531..4aebdadd3b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2898,7 +2898,7 @@ CVerifyDB::~CVerifyDB()
uiInterface.ShowProgress("", 100);
}
-bool CVerifyDB::VerifyDB(int nCheckLevel, int nCheckDepth)
+bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth)
{
LOCK(cs_main);
if (chainActive.Tip() == NULL || chainActive.Tip()->pprev == NULL)
@@ -2911,7 +2911,7 @@ bool CVerifyDB::VerifyDB(int nCheckLevel, int nCheckDepth)
nCheckDepth = chainActive.Height();
nCheckLevel = std::max(0, std::min(4, nCheckLevel));
LogPrintf("Verifying last %i blocks at level %i\n", nCheckDepth, nCheckLevel);
- CCoinsViewCache coins(*pcoinsTip, true);
+ CCoinsViewCache coins(*coinsview, true);
CBlockIndex* pindexState = chainActive.Tip();
CBlockIndex* pindexFailure = NULL;
int nGoodTransactions = 0;
diff --git a/src/main.h b/src/main.h
index 9fe15d3aa3..6b78356642 100644
--- a/src/main.h
+++ b/src/main.h
@@ -871,7 +871,7 @@ class CVerifyDB {
public:
CVerifyDB();
~CVerifyDB();
- bool VerifyDB(int nCheckLevel, int nCheckDepth);
+ bool VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth);
};
/** An in-memory indexed chain of blocks. */
diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp
index 8a4b25cc54..83fe629351 100644
--- a/src/rpcblockchain.cpp
+++ b/src/rpcblockchain.cpp
@@ -432,7 +432,7 @@ Value verifychain(const Array& params, bool fHelp)
if (params.size() > 1)
nCheckDepth = params[1].get_int();
- return CVerifyDB().VerifyDB(nCheckLevel, nCheckDepth);
+ return CVerifyDB().VerifyDB(pcoinsTip, nCheckLevel, nCheckDepth);
}
Value getblockchaininfo(const Array& params, bool fHelp)