Skip to content

Commit 99ec126

Browse files
committed
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
2 parents 77ba4bf + 6c4042a commit 99ec126

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,9 @@ void CWallet::SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator> ran
532532
copyFrom = &mapWallet[hash];
533533
}
534534
}
535+
536+
assert(copyFrom);
537+
535538
// Now copy data from copyFrom to rest:
536539
for (TxSpends::iterator it = range.first; it != range.second; ++it)
537540
{

0 commit comments

Comments
 (0)