incorporate password in the wallet.hash

This commit is contained in:
Lex Berezhny 2019-10-16 12:27:18 -04:00
parent 380efc5ae0
commit 7b5f23e17d

View file

@ -155,6 +155,10 @@ class Wallet:
@property
def hash(self) -> bytes:
h = sha256()
if self.preferences.get(ENCRYPT_ON_DISK, False):
assert self.encryption_password, \
"Encryption is enabled but no password is available, cannot generate hash."
h.update(self.encryption_password.encode())
h.update(self.preferences.hash)
for account in sorted(self.accounts, key=attrgetter('id')):
h.update(account.hash)