Do not run functions with necessary side-effects in assert()

This commit is contained in:
practicalswift committed 2020-12-06 00:48:09 +00:00
1 parent f35e4d906f
commit 281cf99554
2 files changed
+8 -4

No files matched your search

+2 -1
View File
@@ -64,7 +64,8 @@ static void add_coin(CWallet& wallet, const CAmount& nValue, int nAge = 6*24, bo
if (spendable) {
CTxDestination dest;
std::string error;
assert(wallet.GetNewDestination(OutputType::BECH32, "", dest, error));
const bool destination_ok = wallet.GetNewDestination(OutputType::BECH32, "", dest, error);
assert(destination_ok);
tx.vout[nInput].scriptPubKey = GetScriptForDestination(dest);
}
if (fIsFromMe) {