@ -2763,13 +2763,16 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
pwalletMain - > fRescanning = true ;
CBlockIndex * pindex = pindexStart ;
pwalletMain - > rescanStartHeight = pindex - > GetHeight ( ) ;
pwalletMain - > rescanHeight = pwalletMain - > rescanStartHeight ;
{
LOCK2 ( cs_main , cs_wallet ) ;
// no need to read and scan block, if block was created before
// our wallet birthday (as adjusted for block time variability)
while ( pindex & & nTimeFirstKey & & ( pindex - > GetBlockTime ( ) < ( nTimeFirstKey - 7200 ) ) )
while ( pindex & & nTimeFirstKey & & ( pindex - > GetBlockTime ( ) < ( nTimeFirstKey - 7200 ) ) ) {
pindex = chainActive . Next ( pindex ) ;
pwalletMain - > rescanHeight = pindex - > GetHeight ( ) ;
}
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 ) ;
@ -2777,7 +2780,6 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
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 ) ) ) ) ;
@ -2821,6 +2823,8 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
nNow = GetTime ( ) ;
LogPrintf ( " Still rescanning. At block %d. Progress=%f \n " , pindex - > GetHeight ( ) , Checkpoints : : GuessVerificationProgress ( chainParams . Checkpoints ( ) , pindex ) ) ;
}
// update rescan height before we scan the next block
pwalletMain - > rescanHeight = pindex - > GetHeight ( ) ;
pindex = chainActive . Next ( pindex ) ;
}