Skip to content

Commit 134392f

Browse files
laanwjPastaPastaPasta
authored andcommitted
Merge bitcoin#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 bitcoin#9573. Tree-SHA512: 83cbcb32c52c94fcfefbc90ec7de2011dacd6bdb0da35adc401b8d8dda6a86de2fa0403e2158592268c2cf15eef4f3d887d98c90f1031d4735d5f4bf9dbc1d23
1 parent 354f57a commit 134392f

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
@@ -679,6 +679,9 @@ void CWallet::SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator> ran
679679
copyFrom = &mapWallet[hash];
680680
}
681681
}
682+
683+
assert(copyFrom);
684+
682685
// Now copy data from copyFrom to rest:
683686
for (TxSpends::iterator it = range.first; it != range.second; ++it)
684687
{

0 commit comments

Comments
 (0)