From 7b5f23e17d37050b331f682ef19bfa4dc7fe0665 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 16 Oct 2019 12:27:18 -0400 Subject: [PATCH] incorporate password in the wallet.hash --- torba/torba/client/wallet.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/torba/torba/client/wallet.py b/torba/torba/client/wallet.py index e2109142d..3f85d88a0 100644 --- a/torba/torba/client/wallet.py +++ b/torba/torba/client/wallet.py @@ -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)