diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-12-02 12:33:22 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2022-12-02 12:39:16 -0300 |
commit | 7362f8e5e2497bc1ef27bfa871fc6dd306dd33c3 (patch) | |
tree | cb2b8df5cc02af838217135df819f8ceb900f2fc /src/wallet/spend.cpp | |
parent | 3282fad59908da328f8323e1213344fe58ccf69e (diff) |
refactor: make CoinsResult total amounts members private
Diffstat (limited to 'src/wallet/spend.cpp')
-rw-r--r-- | src/wallet/spend.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index 19f9048dbf..52d10b74b5 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -332,7 +332,7 @@ CoinsResult AvailableCoins(const CWallet& wallet, // Checks the sum amount of all UTXO's. if (params.min_sum_amount != MAX_MONEY) { - if (result.total_amount >= params.min_sum_amount) { + if (result.GetTotalAmount() >= params.min_sum_amount) { return result; } } @@ -356,7 +356,7 @@ CoinsResult AvailableCoinsListUnspent(const CWallet& wallet, const CCoinControl* CAmount GetAvailableBalance(const CWallet& wallet, const CCoinControl* coinControl) { LOCK(wallet.cs_wallet); - return AvailableCoins(wallet, coinControl).total_amount; + return AvailableCoins(wallet, coinControl).GetTotalAmount(); } const CTxOut& FindNonChangeParentOutput(const CWallet& wallet, const CTransaction& tx, int output) @@ -586,8 +586,8 @@ std::optional<SelectionResult> SelectCoins(const CWallet& wallet, CoinsResult& a // Return early if we cannot cover the target with the wallet's UTXO. // We use the total effective value if we are not subtracting fee from outputs and 'available_coins' contains the data. - CAmount available_coins_total_amount = coin_selection_params.m_subtract_fee_outputs ? available_coins.total_amount : - (available_coins.total_effective_amount.has_value() ? *available_coins.total_effective_amount : 0); + CAmount available_coins_total_amount = coin_selection_params.m_subtract_fee_outputs ? available_coins.GetTotalAmount() : + (available_coins.GetEffectiveTotalAmount().has_value() ? *available_coins.GetEffectiveTotalAmount() : 0); if (selection_target > available_coins_total_amount) { return std::nullopt; // Insufficient funds } |