cached wallet id

This commit is contained in:
Jack Robison 2020-01-27 13:17:59 -05:00
parent 400d79d6ab
commit 6fb1c72b7d
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -74,12 +74,10 @@ class Wallet:
self.storage = storage or WalletStorage()
self.preferences = TimestampedPreferences(preferences or {})
self.encryption_password = None
self.id = self.get_id()
@property
def id(self):
if self.storage.path:
return os.path.basename(self.storage.path)
return self.name
def get_id(self):
return os.path.basename(self.storage.path) if self.storage.path else self.name
def add_account(self, account: 'Account'):
self.accounts.append(account)