| 85 | } |
| 86 | |
| 87 | CAmount TxGetChange(const CWallet& wallet, const CTransaction& tx) |
| 88 | { |
| 89 | LOCK(wallet.cs_wallet); |
| 90 | CAmount nChange = 0; |
| 91 | for (const CTxOut& txout : tx.vout) |
| 92 | { |
| 93 | nChange += OutputGetChange(wallet, txout); |
| 94 | if (!MoneyRange(nChange)) |
| 95 | throw std::runtime_error(std::string(__func__) + ": value out of range"); |
| 96 | } |
| 97 | return nChange; |
| 98 | } |
| 99 | |
| 100 | static CAmount GetCachableAmount(const CWallet& wallet, const CWalletTx& wtx, CWalletTx::AmountType type, bool avoid_reuse) |
| 101 | { |
no test coverage detected