aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/spend.cpp
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2022-12-06 12:39:00 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2023-04-03 17:23:42 -0300
commitdc1cc1c35995dc09085b3d9270c445b7923fdb51 (patch)
tree08e07a0b545fff6de076eba22a56a0dbddc747c0 /src/wallet/spend.cpp
parent5150e280103dd41c8a438ce72359b0f25ff23a2f (diff)
downloadbitcoin-dc1cc1c35995dc09085b3d9270c445b7923fdb51.tar.xz
gui: bugfix, getAvailableBalance skips selected coins
The previous behavior for getAvailableBalance when coin control has selected coins was to return the sum of them. Instead, we are currently returning the wallet's available total balance minus the selected coins total amount. This turns into a GUI-only issue for the "use available balance" button when the user manually select coins in the send screen. Reason: We missed to update the GetAvailableBalance function to include the coin control selected coins on #25685. Context: Since #25685 we skip the selected coins inside `AvailableCoins`, the reason is that there is no need to traverse the wallet's txes map just to get coins that can directly be fetched by their id.
Diffstat (limited to 'src/wallet/spend.cpp')
-rw-r--r--src/wallet/spend.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp
index 4548d5f813..57f3785a3a 100644
--- a/src/wallet/spend.cpp
+++ b/src/wallet/spend.cpp
@@ -356,12 +356,6 @@ CoinsResult AvailableCoinsListUnspent(const CWallet& wallet, const CCoinControl*
return AvailableCoins(wallet, coinControl, /*feerate=*/ std::nullopt, params);
}
-CAmount GetAvailableBalance(const CWallet& wallet, const CCoinControl* coinControl)
-{
- LOCK(wallet.cs_wallet);
- return AvailableCoins(wallet, coinControl).GetTotalAmount();
-}
-
const CTxOut& FindNonChangeParentOutput(const CWallet& wallet, const COutPoint& outpoint)
{
AssertLockHeld(wallet.cs_wallet);