Commit 702d6477 authored by presstab's avatar presstab

Do not delete record of used stake pointer on disconnect if just verifying db.

parent b6a60957
......@@ -1285,11 +1285,14 @@ bool AppInit2(boost::thread_group& threadGroup)
}
uiInterface.InitMessage(_("Verifying blocks..."));
fVerifying = true;
if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3),
GetArg("-checkblocks", 288))) {
strLoadError = _("Corrupted block database detected");
fVerifying = false;
break;
}
fVerifying = false;
} catch(std::exception &e) {
if (fDebug) LogPrintf("%s\n", e.what());
strLoadError = _("Error opening block database");
......
......@@ -65,6 +65,7 @@ CConditionVariable cvBlockChange;
int nScriptCheckThreads = 0;
bool fImporting = false;
bool fReindex = false;
bool fVerifying = false;
bool fTxIndex = true;
bool fIsBareMultisigStd = true;
bool fCheckBlockIndex = false;
......@@ -2040,7 +2041,7 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
}
// Undo stake pointer
if (pindex->IsProofOfStake()) {
if (!fVerifying && pindex->IsProofOfStake()) {
COutPoint stakeSource(pindex->stakeSource.first, pindex->stakeSource.second);
mapUsedStakePointers.erase(stakeSource.GetHash());
}
......
......@@ -135,6 +135,7 @@ extern CWaitableCriticalSection csBestBlock;
extern CConditionVariable cvBlockChange;
extern bool fImporting;
extern bool fReindex;
extern bool fVerifying;
extern int nScriptCheckThreads;
extern bool fTxIndex;
extern bool fIsBareMultisigStd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment