From 7247130aafda6879cdcc619076fee1ce1ddbca74 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 19 Jan 2024 15:22:28 +0000 Subject: [PATCH] adb: get_balance: add comment about #8835 > These kind of checks look incorrect and confused/confusing for me: > https://github.com/spesmilo/electrum/blob/43a5d034268e4bb6e3dfa3db3fa632642c154d68/electrum/gui/qml/qeinvoice.py#L388 > https://github.com/spesmilo/electrum/blob/43a5d034268e4bb6e3dfa3db3fa632642c154d68/electrum/gui/qt/main_window.py#L1801 > For example, consider creating a local tx that spends all UTXOs in the wallet, and consolidates them to another ismine address. > Such a tx basically does not change what wallet.get_balance() returns. > but to the checks listed above, the confirmed balance of the wallet I guess should be 0? --- electrum/address_synchronizer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/electrum/address_synchronizer.py b/electrum/address_synchronizer.py index ed1a34df0..437da067b 100644 --- a/electrum/address_synchronizer.py +++ b/electrum/address_synchronizer.py @@ -860,6 +860,7 @@ class AddressSynchronizer(Logger, EventListener): excluded_coins: Set[str] = None) -> Tuple[int, int, int]: """Return the balance of a set of addresses: confirmed and matured, unconfirmed, unmatured + Note: intended for display-purposes. would need extreme care for "has enough funds" checks (see #8835) """ if excluded_addresses is None: excluded_addresses = set()