fix multisig update_password
This commit is contained in:
parent
98353c286a
commit
9cb576a88c
|
@ -84,7 +84,7 @@ class WalletStorage(PrintError):
|
||||||
|
|
||||||
def set_password(self, pw, encrypt):
|
def set_password(self, pw, encrypt):
|
||||||
"""Set self.pubkey"""
|
"""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)
|
self.decrypt(None, pw if encrypt else None)
|
||||||
|
|
||||||
def is_encrypted(self):
|
def is_encrypted(self):
|
||||||
|
|
|
@ -1682,12 +1682,12 @@ class Multisig_Wallet(Deterministic_Wallet, P2SH):
|
||||||
def get_keystores(self):
|
def get_keystores(self):
|
||||||
return [self.keystores[i] for i in sorted(self.keystores.keys())]
|
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():
|
for name, keystore in self.keystores.items():
|
||||||
if keystore.can_change_password():
|
if keystore.can_change_password():
|
||||||
keystore.update_password(old_pw, new_pw)
|
keystore.update_password(old_pw, new_pw)
|
||||||
self.storage.put(name, keystore.dump())
|
self.storage.put(name, keystore.dump())
|
||||||
self.storage.set_password(new_pw)
|
self.storage.set_password(new_pw, encrypt)
|
||||||
|
|
||||||
def check_password(self, password):
|
def check_password(self, password):
|
||||||
self.keystore.check_password(password)
|
self.keystore.check_password(password)
|
||||||
|
|
|
@ -442,8 +442,8 @@ class TrustedCoinPlugin(BasePlugin):
|
||||||
long_user_id, short_id = get_user_id(storage)
|
long_user_id, short_id = get_user_id(storage)
|
||||||
xpub3 = make_xpub(signing_xpub, long_user_id)
|
xpub3 = make_xpub(signing_xpub, long_user_id)
|
||||||
k3 = keystore.from_xpub(xpub3)
|
k3 = keystore.from_xpub(xpub3)
|
||||||
storage.put('use_encryption', bool(password))
|
|
||||||
storage.put('x3/', k3.dump())
|
storage.put('x3/', k3.dump())
|
||||||
|
storage.set_password(password, encrypt)
|
||||||
wizard.wallet = Wallet_2fa(storage)
|
wizard.wallet = Wallet_2fa(storage)
|
||||||
wizard.create_addresses()
|
wizard.create_addresses()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue