Browse Source

fix: wallet.is_used

283
ThomasV 10 years ago
parent
commit
714445aba8
  1. 3
      gui/qt/main_window.py
  2. 5
      lib/wallet.py

3
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)

5
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 {}

Loading…
Cancel
Save