commit bd309cff49370874a85dc4437e3f515266677275
parent c2accd64cfb83836de52b9b7eb100d608dc61a98
Author: ThomasV <thomasv@electrum.org>
Date: Mon, 4 Jan 2016 15:40:57 +0100
restore default labels
Diffstat:
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -880,8 +880,21 @@ class Abstract_Wallet(PrintError):
def get_label(self, tx_hash):
label = self.labels.get(tx_hash, '')
+ if label is '':
+ label = self.get_default_label(tx_hash)
return label
+ def get_default_label(self, tx_hash):
+ if self.txi.get(tx_hash) == {}:
+ d = self.txo.get(tx_hash, {})
+ labels = []
+ for addr in d.keys():
+ label = self.labels.get(addr)
+ if label:
+ labels.append(label)
+ return ', '.join(labels)
+ return ''
+
def fee_per_kb(self, config):
b = config.get('dynamic_fees')
f = config.get('fee_factor', 50)