Initial implementation of getrescaninfo
This commit is contained in:
@@ -2760,6 +2760,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
|
||||
if(fZdebug)
|
||||
LogPrintf("%s: fUpdate=%d now=%li\n",__func__,fUpdate,nNow);
|
||||
|
||||
pwalletMain->fRescanning = true;
|
||||
CBlockIndex* pindex = pindexStart;
|
||||
{
|
||||
LOCK2(cs_main, cs_wallet);
|
||||
@@ -2772,8 +2773,11 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
|
||||
ShowProgress(_("Rescanning..."), 0); // show rescan progress in GUI as dialog or on splashscreen, if -rescan on startup
|
||||
double dProgressStart = Checkpoints::GuessVerificationProgress(chainParams.Checkpoints(), pindex, false);
|
||||
double dProgressTip = Checkpoints::GuessVerificationProgress(chainParams.Checkpoints(), chainActive.LastTip(), false);
|
||||
|
||||
pwalletMain->rescanStartHeight = pindex->GetHeight();
|
||||
while (pindex)
|
||||
{
|
||||
pwalletMain->rescanHeight = pindex->GetHeight();
|
||||
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))));
|
||||
|
||||
@@ -2825,6 +2829,9 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
|
||||
|
||||
ShowProgress(_("Rescanning..."), 100); // hide progress dialog in GUI
|
||||
}
|
||||
|
||||
// we are no longer rescanning
|
||||
pwalletMain->fRescanning = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user