Skip to content

Commit

Permalink
Merge bitcoin#11074: Assert that CWallet::SyncMetaData finds oldest t…
Browse files Browse the repository at this point in the history
…ransaction.

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
  • Loading branch information
laanwj authored and PastaPastaPasta committed Jan 12, 2020
1 parent 03e4213 commit a1a6760
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wallet/wallet.cpp
Expand Up @@ -680,6 +680,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)
{
Expand Down

0 comments on commit a1a6760

Please sign in to comment.