Browse Source

redo default labels with incoming tx outputs

283
ThomasV 10 years ago
parent
commit
0a7b585b6c
  1. 4
      gui/qt/main_window.py
  2. 9
      lib/wallet.py

4
gui/qt/main_window.py

@ -676,8 +676,6 @@ class ElectrumWindow(QMainWindow):
v_str = self.format_amount(value, True, whitespaces=True)
balance_str = self.format_amount(balance, whitespaces=True)
label, is_default_label = self.wallet.get_label(tx_hash)
if is_default_label:
label = ''
item = QTreeWidgetItem( [ '', time_str, label, v_str, balance_str] )
item.setFont(2, QFont(MONOSPACE_FONT))
item.setFont(3, QFont(MONOSPACE_FONT))
@ -687,7 +685,7 @@ class ElectrumWindow(QMainWindow):
if tx_hash:
item.setData(0, Qt.UserRole, tx_hash)
if is_default_label:
item.setForeground(2, QBrush(QColor('lightgrey')))
item.setForeground(2, QBrush(QColor('grey')))
item.setIcon(0, icon)
l.insertTopLevelItem(0, item)
if current_tx == tx_hash:

9
lib/wallet.py

@ -775,6 +775,15 @@ class Abstract_Wallet(object):
return label, is_default
def get_default_label(self, tx_hash):
if self.txi.get(tx_hash) == {}:
d = self.txo.get(tx_hash, {})
for addr in d.keys():
assert self.is_mine(addr)
label = self.labels.get(addr)
if label:
break
label = ">" + addr
return label
return tx_hash
def get_tx_fee(self, tx):

Loading…
Cancel
Save