mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-17 18:40:09 +00:00
Merge #8136: Log/report in 10% steps during VerifyDB
8b78486 Log/report in 10% steps during VerifyDB (Jonas Schnelli)
This commit is contained in:
commit
22e0b35676
11
src/main.cpp
11
src/main.cpp
@ -3883,10 +3883,18 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
|
|||||||
CBlockIndex* pindexFailure = NULL;
|
CBlockIndex* pindexFailure = NULL;
|
||||||
int nGoodTransactions = 0;
|
int nGoodTransactions = 0;
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
|
int reportDone = 0;
|
||||||
|
LogPrintf("[0%]...");
|
||||||
for (CBlockIndex* pindex = chainActive.Tip(); pindex && pindex->pprev; pindex = pindex->pprev)
|
for (CBlockIndex* pindex = chainActive.Tip(); pindex && pindex->pprev; pindex = pindex->pprev)
|
||||||
{
|
{
|
||||||
boost::this_thread::interruption_point();
|
boost::this_thread::interruption_point();
|
||||||
uiInterface.ShowProgress(_("Verifying blocks..."), std::max(1, std::min(99, (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100)))));
|
int percentageDone = std::max(1, std::min(99, (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100))));
|
||||||
|
if (reportDone < percentageDone/10) {
|
||||||
|
// report every 10% step
|
||||||
|
LogPrintf("[%d%%]...", percentageDone);
|
||||||
|
reportDone = percentageDone/10;
|
||||||
|
}
|
||||||
|
uiInterface.ShowProgress(_("Verifying blocks..."), percentageDone);
|
||||||
if (pindex->nHeight < chainActive.Height()-nCheckDepth)
|
if (pindex->nHeight < chainActive.Height()-nCheckDepth)
|
||||||
break;
|
break;
|
||||||
if (fPruneMode && !(pindex->nStatus & BLOCK_HAVE_DATA)) {
|
if (fPruneMode && !(pindex->nStatus & BLOCK_HAVE_DATA)) {
|
||||||
@ -3944,6 +3952,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LogPrintf("[DONE].\n");
|
||||||
LogPrintf("No coin database inconsistencies in last %i blocks (%i transactions)\n", chainActive.Height() - pindexState->nHeight, nGoodTransactions);
|
LogPrintf("No coin database inconsistencies in last %i blocks (%i transactions)\n", chainActive.Height() - pindexState->nHeight, nGoodTransactions);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user