Browse Source

wallet: change meaning of is_used

3.2.x
SomberNight 7 years ago
parent
commit
cf14d7b346
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 5
      electrum/address_synchronizer.py
  2. 8
      electrum/gui/kivy/uix/dialogs/addresses.py
  3. 6
      electrum/gui/qt/address_list.py

5
electrum/address_synchronizer.py

@ -757,10 +757,7 @@ class AddressSynchronizer(PrintError):
def is_used(self, address):
h = self.history.get(address,[])
if len(h) == 0:
return False
c, u, x = self.get_addr_balance(address)
return c + u + x == 0
return len(h) != 0
def is_empty(self, address):
c, u, x = self.get_addr_balance(address)

8
electrum/gui/kivy/uix/dialogs/addresses.py

@ -136,14 +136,14 @@ class AddressesDialog(Factory.Popup):
for address in _list:
label = wallet.labels.get(address, '')
balance = sum(wallet.get_addr_balance(address))
is_used = wallet.is_used(address)
if self.show_used == 1 and (balance or is_used):
is_used_and_empty = wallet.is_used(address) and balance == 0
if self.show_used == 1 and (balance or is_used_and_empty):
continue
if self.show_used == 2 and balance == 0:
continue
if self.show_used == 3 and not is_used:
if self.show_used == 3 and not is_used_and_empty:
continue
card = self.get_card(address, balance, is_used, label)
card = self.get_card(address, balance, is_used_and_empty, label)
if search and not self.ext_search(card, search):
continue
cards.append(card)

6
electrum/gui/qt/address_list.py

@ -95,15 +95,15 @@ class AddressList(MyTreeWidget):
self.clear()
for address in addr_list:
num = len(self.wallet.get_address_history(address))
is_used = self.wallet.is_used(address)
label = self.wallet.labels.get(address, '')
c, u, x = self.wallet.get_addr_balance(address)
balance = c + u + x
if self.show_used == 1 and (balance or is_used):
is_used_and_empty = self.wallet.is_used(address) and balance == 0
if self.show_used == 1 and (balance or is_used_and_empty):
continue
if self.show_used == 2 and balance == 0:
continue
if self.show_used == 3 and not is_used:
if self.show_used == 3 and not is_used_and_empty:
continue
balance_text = self.parent.format_amount(balance, whitespaces=True)
fx = self.parent.fx

Loading…
Cancel
Save