diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-11-09 15:19:55 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-11-09 15:20:18 +0100 |
commit | 99ec12666ba78b33dded2200e8bd0e5de04f7734 (patch) | |
tree | 60487ebf1cc6f019f09afd9846b19d139261d75f /src/wallet | |
parent | 77ba4bf960d315ae826f78b786882757bc89ff59 (diff) | |
parent | 6c4042a5d0796b732f441669117b909a3247e465 (diff) | |
download | bitcoin-99ec12666ba78b33dded2200e8bd0e5de04f7734.tar.xz |
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
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 102a5644d6..a357224a86 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -532,6 +532,9 @@ void CWallet::SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator> ran copyFrom = &mapWallet[hash]; } } + + assert(copyFrom); + // Now copy data from copyFrom to rest: for (TxSpends::iterator it = range.first; it != range.second; ++it) { |