Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 4,584 Lines • ▼ Show 20 Lines | LogPrintf("Verifying last %i blocks at level %i\n", nCheckDepth, | ||||
nCheckLevel); | nCheckLevel); | ||||
CCoinsViewCache coins(coinsview); | CCoinsViewCache coins(coinsview); | ||||
CBlockIndex *pindexState = chainActive.Tip(); | CBlockIndex *pindexState = chainActive.Tip(); | ||||
CBlockIndex *pindexFailure = nullptr; | CBlockIndex *pindexFailure = nullptr; | ||||
int nGoodTransactions = 0; | int nGoodTransactions = 0; | ||||
CValidationState state; | CValidationState state; | ||||
int reportDone = 0; | int reportDone = 0; | ||||
LogPrintf("[0%%]..."); | LogPrintfToBeContinued("[0%%]..."); | ||||
for (CBlockIndex *pindex = chainActive.Tip(); pindex && pindex->pprev; | for (CBlockIndex *pindex = chainActive.Tip(); pindex && pindex->pprev; | ||||
pindex = pindex->pprev) { | pindex = pindex->pprev) { | ||||
boost::this_thread::interruption_point(); | boost::this_thread::interruption_point(); | ||||
int percentageDone = std::max( | int percentageDone = std::max( | ||||
1, std::min( | 1, std::min( | ||||
99, | 99, | ||||
(int)(((double)(chainActive.Height() - pindex->nHeight)) / | (int)(((double)(chainActive.Height() - pindex->nHeight)) / | ||||
(double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100)))); | (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100)))); | ||||
if (reportDone < percentageDone / 10) { | if (reportDone < percentageDone / 10) { | ||||
// report every 10% step | // report every 10% step | ||||
LogPrintf("[%d%%]...", percentageDone); | LogPrintfToBeContinued("[%d%%]...", percentageDone); | ||||
reportDone = percentageDone / 10; | reportDone = percentageDone / 10; | ||||
} | } | ||||
uiInterface.ShowProgress(_("Verifying blocks..."), percentageDone, | uiInterface.ShowProgress(_("Verifying blocks..."), percentageDone, | ||||
false); | false); | ||||
if (pindex->nHeight < chainActive.Height() - nCheckDepth) { | if (pindex->nHeight < chainActive.Height() - nCheckDepth) { | ||||
break; | break; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,083 Lines • Show Last 20 Lines |