Initial implementation of abortrescan
This commit is contained in:
@@ -2778,6 +2778,19 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
|
||||
while (pindex)
|
||||
{
|
||||
pwalletMain->rescanHeight = pindex->GetHeight();
|
||||
if(pwalletMain->fAbortRescan) {
|
||||
//TODO: should we update witness caches?
|
||||
LogPrintf("%s: Rescan aborted at block %d\n", pwalletMain->rescanHeight);
|
||||
pwalletMain->fRescanning = false;
|
||||
return ret;
|
||||
}
|
||||
if (ShutdownRequested()) {
|
||||
//TODO: should we update witness caches?
|
||||
LogPrintf("%s: Rescan interrupted by shutdown request at block %d\n", pwalletMain->rescanHeight);
|
||||
pwalletMain->fRescanning = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (pindex->GetHeight() % 100 == 0 && dProgressTip - dProgressStart > 0.0)
|
||||
ShowProgress(_("Rescanning..."), std::max(1, std::min(99, (int)((Checkpoints::GuessVerificationProgress(chainParams.Checkpoints(), pindex, false) - dProgressStart) / (dProgressTip - dProgressStart) * 100))));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user