Merge #13683: wallet: Introduce assertion to document the assumption that cache and cache_used are always set in tandem

d06330396f wallet: Avoid potential null pointer dereference in CWalletTx::GetAvailableCredit(...) (practicalswift)

Pull request description:

  Avoid potential null pointer dereference in `CWalletTx::GetAvailableCredit(...)`.

  Introduced in 4279da4785.

Tree-SHA512: 92d1da9682f0bab11f6f96395ca30549331b0a056cbceb7e1a7f98b3d17d10082aaeed0907cafd46f4164b0e0f4b77e01f78bfd7d24e0503a66c6942ae842aa5
This commit is contained in:
MarcoFalke 2018-07-22 08:34:07 -04:00
commit e8c74348d3
No known key found for this signature in database
GPG key ID: D2EA4850E7528B25

View file

@ -1977,6 +1977,7 @@ CAmount CWalletTx::GetAvailableCredit(bool fUseCache, const isminefilter& filter
if (cache) {
*cache = nCredit;
assert(cache_used);
*cache_used = true;
}
return nCredit;