Browse Source

define wallet.get_num_tx()

283
ecdsa 12 years ago
parent
commit
d6952228be
  1. 5
      gui/gui_classic.py
  2. 5
      gui/gui_gtk.py
  3. 6
      lib/wallet.py

5
gui/gui_classic.py

@ -1131,10 +1131,7 @@ class ElectrumWindow(QMainWindow):
for address in self.wallet.addressbook: for address in self.wallet.addressbook:
label = self.wallet.labels.get(address,'') label = self.wallet.labels.get(address,'')
n = 0 n = self.wallet.get_num_tx(address)
for tx in self.wallet.transactions.values():
if address in map(lambda x: x[0], tx.outputs): n += 1
item = QTreeWidgetItem( [ address, label, "%d"%n] ) item = QTreeWidgetItem( [ address, label, "%d"%n] )
item.setFont(0, QFont(MONOSPACE_FONT)) item.setFont(0, QFont(MONOSPACE_FONT))
# 32 = label can be edited (bool) # 32 = label can be edited (bool)

5
gui/gui_gtk.py

@ -1152,10 +1152,7 @@ class ElectrumWindow:
for address in self.wallet.addressbook: for address in self.wallet.addressbook:
label = self.wallet.labels.get(address) label = self.wallet.labels.get(address)
n = 0 n = self.wallet.get_num_tx(address)
for tx in self.wallet.transactions.values():
if address in map(lambda x:x[0], tx.outputs): n += 1
self.addressbook_list.append((address, label, "%d"%n)) self.addressbook_list.append((address, label, "%d"%n))
def update_history_tab(self): def update_history_tab(self):

6
lib/wallet.py

@ -407,6 +407,12 @@ class Wallet:
# redo labels # redo labels
# self.update_tx_labels() # self.update_tx_labels()
def get_num_tx(self, address):
n = 0
for tx in self.transactions.values():
if address in map(lambda x:x[0], tx.outputs): n += 1
return n
def get_address_flags(self, addr): def get_address_flags(self, addr):
flags = "C" if self.is_change(addr) else "I" if addr in self.imported_keys.keys() else "-" flags = "C" if self.is_change(addr) else "I" if addr in self.imported_keys.keys() else "-"

Loading…
Cancel
Save