Skip to content

Commit c36ea69

Browse files
committed
[wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call.
1 parent 1b25b6d commit c36ea69

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/wallet/wallet.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,6 +1544,10 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool f
15441544
{
15451545
if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0)
15461546
ShowProgress(_("Rescanning..."), std::max(1, std::min(99, (int)((GuessVerificationProgress(chainParams.TxData(), pindex) - dProgressStart) / (dProgressTip - dProgressStart) * 100))));
1547+
if (GetTime() >= nNow + 60) {
1548+
nNow = GetTime();
1549+
LogPrintf("Still rescanning. At block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));
1550+
}
15471551

15481552
CBlock block;
15491553
if (ReadBlockFromDisk(block, pindex, Params().GetConsensus())) {
@@ -1557,10 +1561,6 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool f
15571561
ret = nullptr;
15581562
}
15591563
pindex = chainActive.Next(pindex);
1560-
if (GetTime() >= nNow + 60) {
1561-
nNow = GetTime();
1562-
LogPrintf("Still rescanning. At block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));
1563-
}
15641564
}
15651565
if (pindex && fAbortRescan) {
15661566
LogPrintf("Rescan aborted at block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));

0 commit comments

Comments
 (0)