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 4279da47855ec776f8d57c6579fe89afc9cbe8c1.

Tree-SHA512: 92d1da9682f0bab11f6f96395ca30549331b0a056cbceb7e1a7f98b3d17d10082aaeed0907cafd46f4164b0e0f4b77e01f78bfd7d24e0503a66c6942ae842aa5
This commit is contained in:
MarcoFalke 2018-07-22 08:34:07 -04:00 committed by pasta
parent cd59867e7b
commit 7b8eb59178

View File

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