Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 1,821 Lines • ▼ Show 20 Lines | if (pindex) { | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
tip = chainActive.Tip(); | tip = chainActive.Tip(); | ||||
dProgressStart = | dProgressStart = | ||||
GuessVerificationProgress(chainParams.TxData(), pindex); | GuessVerificationProgress(chainParams.TxData(), pindex); | ||||
dProgressTip = GuessVerificationProgress(chainParams.TxData(), tip); | dProgressTip = GuessVerificationProgress(chainParams.TxData(), tip); | ||||
} | } | ||||
double gvp = dProgressStart; | double gvp = dProgressStart; | ||||
while (pindex && !fAbortRescan) { | while (pindex && !fAbortRescan && !ShutdownRequested()) { | ||||
if (pindex->nHeight % 100 == 0 && | if (pindex->nHeight % 100 == 0 && | ||||
dProgressTip - dProgressStart > 0.0) { | dProgressTip - dProgressStart > 0.0) { | ||||
ShowProgress( | ShowProgress( | ||||
_("Rescanning..."), | _("Rescanning..."), | ||||
std::max( | std::max( | ||||
1, std::min(99, (int)((gvp - dProgressStart) / | 1, std::min(99, (int)((gvp - dProgressStart) / | ||||
(dProgressTip - dProgressStart) * | (dProgressTip - dProgressStart) * | ||||
100)))); | 100)))); | ||||
Show All 36 Lines | if (pindex) { | ||||
GuessVerificationProgress(chainParams.TxData(), tip); | GuessVerificationProgress(chainParams.TxData(), tip); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (pindex && fAbortRescan) { | if (pindex && fAbortRescan) { | ||||
LogPrintf("Rescan aborted at block %d. Progress=%f\n", | LogPrintf("Rescan aborted at block %d. Progress=%f\n", | ||||
pindex->nHeight, gvp); | pindex->nHeight, gvp); | ||||
} else if (pindex && ShutdownRequested()) { | |||||
LogPrintf("Rescan interrupted by shutdown request at block %d. " | |||||
"Progress=%f\n", | |||||
pindex->nHeight, gvp); | |||||
} | } | ||||
// Hide progress dialog in GUI. | // Hide progress dialog in GUI. | ||||
ShowProgress(_("Rescanning..."), 100); | ShowProgress(_("Rescanning..."), 100); | ||||
} | } | ||||
return ret; | return ret; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,892 Lines • Show Last 20 Lines |