aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.h
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2022-04-27 11:26:15 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2022-08-12 13:06:05 -0300
commit050e8b139145d6991e740b0e5f2b3364663dd348 (patch)
tree4fd97eb4024445bcbee968264f9e4adc46ac447c /src/qt/walletmodel.h
parent96e3264a82c51b456703f500bd98e8cb98115697 (diff)
downloadbitcoin-050e8b139145d6991e740b0e5f2b3364663dd348.tar.xz
GUI: 'getAvailableBalance', use cached balance if the user did not select UTXO manually
No need to walk through the entire wallet's tx map. Used for 'walletModel::prepareTransaction' and 'useAvailable' flow in sendcoinsdialog.
Diffstat (limited to 'src/qt/walletmodel.h')
-rw-r--r--src/qt/walletmodel.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index 18951c2858..afe93c43e0 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -160,6 +160,10 @@ public:
// Retrieve the cached wallet balance
interfaces::WalletBalances getCachedBalance() const;
+ // If coin control has selected outputs, searches the total amount inside the wallet.
+ // Otherwise, uses the wallet's cached available balance.
+ CAmount getAvailableBalance(const wallet::CCoinControl* control);
+
private:
std::unique_ptr<interfaces::Wallet> m_wallet;
std::unique_ptr<interfaces::Handler> m_handler_unload;