Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 2,197 Lines • ▼ Show 20 Lines | WalletLogPrintf("Rescan started from block %s...\n", | ||||
} | } | ||||
block_height = locked_chain->getBlockHeight(block_hash); | block_height = locked_chain->getBlockHeight(block_hash); | ||||
progress_begin = chain().guessVerificationProgress(block_hash); | progress_begin = chain().guessVerificationProgress(block_hash); | ||||
progress_end = chain().guessVerificationProgress( | progress_end = chain().guessVerificationProgress( | ||||
stop_block.IsNull() ? tip_hash : stop_block); | stop_block.IsNull() ? tip_hash : stop_block); | ||||
} | } | ||||
double progress_current = progress_begin; | double progress_current = progress_begin; | ||||
while (block_height && !fAbortRescan && !chain().shutdownRequested()) { | while (block_height && !fAbortRescan && !chain().shutdownRequested()) { | ||||
m_scanning_progress = (progress_current - progress_begin) / | |||||
(progress_end - progress_begin); | |||||
if (*block_height % 100 == 0 && | if (*block_height % 100 == 0 && | ||||
progress_end - progress_begin > 0.0) { | progress_end - progress_begin > 0.0) { | ||||
ShowProgress( | ShowProgress( | ||||
strprintf("%s " + _("Rescanning...").translated, | strprintf("%s " + _("Rescanning...").translated, | ||||
GetDisplayName()), | GetDisplayName()), | ||||
std::max( | std::max(1, std::min(99, int(m_scanning_progress * 100)))); | ||||
1, | |||||
std::min(99, (int)((progress_current - progress_begin) / | |||||
(progress_end - progress_begin) * | |||||
100)))); | |||||
} | } | ||||
if (GetTime() >= nNow + 60) { | if (GetTime() >= nNow + 60) { | ||||
nNow = GetTime(); | nNow = GetTime(); | ||||
WalletLogPrintf("Still rescanning. At block %d. Progress=%f\n", | WalletLogPrintf("Still rescanning. At block %d. Progress=%f\n", | ||||
*block_height, progress_current); | *block_height, progress_current); | ||||
} | } | ||||
CBlock block; | CBlock block; | ||||
▲ Show 20 Lines • Show All 3,232 Lines • Show Last 20 Lines |