diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 958b3578e..191eae84d 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1703,7 +1703,8 @@ class ElectrumWindow(QMainWindow): used_flag = False addr_list = account.get_addresses(is_change) for address in addr_list: - num, is_used = self.wallet.is_used(address) + num = len(self.wallet.history.get(address,[])) + is_used = self.wallet.is_used(address) label = self.wallet.labels.get(address,'') c, u, x = self.wallet.get_addr_balance(address) balance = self.format_amount(c + u + x) diff --git a/lib/wallet.py b/lib/wallet.py index 98aefb711..653eae0d4 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -1128,7 +1128,7 @@ class Abstract_Wallet(object): def is_used(self, address): h = self.history.get(address,[]) c, u, x = self.get_addr_balance(address) - return len(h), len(h) > 0 and c + u + x == 0 + return len(h) > 0 and c + u + x == 0 def is_empty(self, address): c, u, x = self.get_addr_balance(address) @@ -1346,8 +1346,7 @@ class Imported_Wallet(Abstract_Wallet): self.accounts[IMPORTED_ACCOUNT].get_private_key((0,0), self, password) def is_used(self, address): - h = self.history.get(address,[]) - return len(h), False + return False def get_master_public_keys(self): return {}