From cc05712e7fbae3755a02c4b38f1b643b8519a866 Mon Sep 17 00:00:00 2001 From: sasha Date: Wed, 23 Mar 2022 11:53:42 -0700 Subject: [PATCH] Prevent a pindex == NULL case in the ScanForWalletTransactions traversal --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4809189a1..4697a90d6 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); }