Skip to content

Commit c29a0d4

Browse files
committed
Merge #10265: [wallet] [moveonly] Check non-null pindex before potentially referencing
c36ea69 [wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call. (Karl-Johan Alm) Tree-SHA512: a14c9f3e1228bca91977bea821c56a377d80889b41d250050c9be67aa93e460319a7cf1d4b63ee40f23b5a34159590f0e3fe15dc88698dc694c0c8098bd2db4d
2 parents cb007e4 + c36ea69 commit c29a0d4

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
@@ -1526,6 +1526,10 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool f
15261526
{
15271527
if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0)
15281528
ShowProgress(_("Rescanning..."), std::max(1, std::min(99, (int)((GuessVerificationProgress(chainParams.TxData(), pindex) - dProgressStart) / (dProgressTip - dProgressStart) * 100))));
1529+
if (GetTime() >= nNow + 60) {
1530+
nNow = GetTime();
1531+
LogPrintf("Still rescanning. At block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));
1532+
}
15291533

15301534
CBlock block;
15311535
if (ReadBlockFromDisk(block, pindex, Params().GetConsensus())) {
@@ -1539,10 +1543,6 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool f
15391543
ret = nullptr;
15401544
}
15411545
pindex = chainActive.Next(pindex);
1542-
if (GetTime() >= nNow + 60) {
1543-
nNow = GetTime();
1544-
LogPrintf("Still rescanning. At block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));
1545-
}
15461546
}
15471547
if (pindex && fAbortRescan) {
15481548
LogPrintf("Rescan aborted at block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));

0 commit comments

Comments
 (0)