Skip to content

Commit 9bbf600

Browse files
authored
Use method name from __func__ macro
Use __func__ macro in std::runtime_exception to: 1. fix method name in CWalletTx::GetAvailableWatchOnlyCredit() 2. refactor CWalletTx::GetAvailableCredit()
1 parent 6dbcc74 commit 9bbf600

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ CAmount CWalletTx::GetAvailableCredit(bool fUseCache) const
17181718
const CTxOut &txout = tx->vout[i];
17191719
nCredit += pwallet->GetCredit(txout, ISMINE_SPENDABLE);
17201720
if (!MoneyRange(nCredit))
1721-
throw std::runtime_error("CWalletTx::GetAvailableCredit() : value out of range");
1721+
throw std::runtime_error(std::string(__func__) + " : value out of range");
17221722
}
17231723
}
17241724

@@ -1761,7 +1761,7 @@ CAmount CWalletTx::GetAvailableWatchOnlyCredit(const bool& fUseCache) const
17611761
const CTxOut &txout = tx->vout[i];
17621762
nCredit += pwallet->GetCredit(txout, ISMINE_WATCH_ONLY);
17631763
if (!MoneyRange(nCredit))
1764-
throw std::runtime_error("CWalletTx::GetAvailableCredit() : value out of range");
1764+
throw std::runtime_error(std::string(__func__) + ": value out of range");
17651765
}
17661766
}
17671767

0 commit comments

Comments
 (0)