commit b116a43c31272b85c2d809dce31c01d3aa4fdde6
parent 50d029e61c0c5550d7fe7ec96cb89b0513705375
Author: ThomasV <thomasv@gitorious>
Date: Wed, 27 Feb 2013 21:22:52 +0100
fix the tx counter field
Diffstat:
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/gui.py b/lib/gui.py
@@ -1152,10 +1152,10 @@ class ElectrumWindow:
for address in self.wallet.addressbook:
label = self.wallet.labels.get(address)
n = 0
- for item in self.wallet.transactions.values():
- if address in item['outputs'] : n=n+1
- tx = "None" if n==0 else "%d"%n
- self.addressbook_list.append((address, label, tx))
+ 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))
def update_history_tab(self):
cursor = self.history_treeview.get_cursor()[0]
diff --git a/lib/gui_qt.py b/lib/gui_qt.py
@@ -1262,10 +1262,10 @@ class ElectrumWindow(QMainWindow):
if address in alias_targets: continue
label = self.wallet.labels.get(address,'')
n = 0
- #for item in self.wallet.transactions.values():
- # if address in item['outputs'] : n=n+1
- tx = "%d"%n
- item = QTreeWidgetItem( [ address, label, tx] )
+ 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.setFont(0, QFont(MONOSPACE_FONT))
l.addTopLevelItem(item)