fix multisig update_password

This commit is contained in:
ThomasV 2017-03-04 10:30:05 +01:00
parent 98353c286a
commit 9cb576a88c
3 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ class WalletStorage(PrintError):
def set_password(self, pw, encrypt):
"""Set self.pubkey"""
self.put('use_encryption', (pw is not None))
self.put('use_encryption', bool(pw))
self.decrypt(None, pw if encrypt else None)
def is_encrypted(self):

View File

@ -1682,12 +1682,12 @@ class Multisig_Wallet(Deterministic_Wallet, P2SH):
def get_keystores(self):
return [self.keystores[i] for i in sorted(self.keystores.keys())]
def update_password(self, old_pw, new_pw):
def update_password(self, old_pw, new_pw, encrypt=False):
for name, keystore in self.keystores.items():
if keystore.can_change_password():
keystore.update_password(old_pw, new_pw)
self.storage.put(name, keystore.dump())
self.storage.set_password(new_pw)
self.storage.set_password(new_pw, encrypt)
def check_password(self, password):
self.keystore.check_password(password)

View File

@ -442,8 +442,8 @@ class TrustedCoinPlugin(BasePlugin):
long_user_id, short_id = get_user_id(storage)
xpub3 = make_xpub(signing_xpub, long_user_id)
k3 = keystore.from_xpub(xpub3)
storage.put('use_encryption', bool(password))
storage.put('x3/', k3.dump())
storage.set_password(password, encrypt)
wizard.wallet = Wallet_2fa(storage)
wizard.create_addresses()