1
0

account names

This commit is contained in:
thomasv
2013-09-03 10:09:13 +02:00
parent a417816e69
commit 3ecd81c94a
3 changed files with 18 additions and 7 deletions

View File

@@ -813,10 +813,20 @@ class Wallet:
return c, u
def get_accounts(self):
def get_account_name(self, k):
if k == 0:
if self.seed_version == 4:
name = 'Main account'
else:
name = 'Old account'
else:
name = self.labels.get(k, 'Unnamed account')
return name
def get_account_names(self):
accounts = {}
for k, account in self.accounts.items():
accounts[k] = self.labels.get(k, 'unnamed')
accounts[k] = self.get_account_name(k)
if self.imported_keys:
accounts[-1] = 'Imported keys'
return accounts