From 0f6907e36cb7401701f4fac91490de878b8e5d38 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 9 Nov 2017 15:19:55 +0100 Subject: [PATCH] Merge #11074: Assert that CWallet::SyncMetaData finds oldest transaction. 6c4042a Assert that CWallet::SyncMetaData finds oldest transaction. (Eelis) Pull request description: Without this assert, the Clang static analyzer warns about subsequent dereferencing of copyFrom, because it can't be sure that it's not nullptr. See #9573. Tree-SHA512: 83cbcb32c52c94fcfefbc90ec7de2011dacd6bdb0da35adc401b8d8dda6a86de2fa0403e2158592268c2cf15eef4f3d887d98c90f1031d4735d5f4bf9dbc1d23 --- src/wallet/wallet.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e529821b7c292..746dae73cb618 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -680,6 +680,9 @@ void CWallet::SyncMetaData(std::pair ran copyFrom = &mapWallet[hash]; } } + + assert(copyFrom); + // Now copy data from copyFrom to rest: for (TxSpends::iterator it = range.first; it != range.second; ++it) {