restore default labels

This commit is contained in:
ThomasV 2016-01-04 15:40:57 +01:00
parent c2accd64cf
commit bd309cff49
1 changed files with 13 additions and 0 deletions

View File

@ -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)