diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 72e928e0c..71e32a404 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4303,7 +4303,7 @@ int CWallet::ScanForWalletTransactions( // 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 - TIMESTAMP_WINDOW) { + while (chainActive.Next(pindex) != NULL && nTimeFirstKey && pindex->GetBlockTime() < nTimeFirstKey - TIMESTAMP_WINDOW) { pindex = chainActive.Next(pindex); }