1
0

add get_completions to wallet

This commit is contained in:
ThomasV
2015-03-31 12:01:42 +02:00
parent 4d7b68658b
commit f77311328a
2 changed files with 12 additions and 6 deletions

View File

@@ -391,6 +391,17 @@ class Abstract_Wallet(object):
self.addressbook.remove(addr)
self.storage.put('contacts', list(self.addressbook), True)
def get_completions(self):
l = []
for x in self.addressbook:
if bitcoin.is_address(x):
label = self.labels.get(x)
if label:
l.append( label + ' <' + x + '>')
else:
l.append(x)
return l
def get_num_tx(self, address):
""" return number of transactions where address is involved """
return len(self.history.get(address, []))