fix #9870
This commit is contained in:
@@ -198,7 +198,7 @@ class WalletInfoDialog(WindowModalDialog):
|
||||
return
|
||||
keystore, is_hardware = result
|
||||
for k in self.wallet.get_keystores():
|
||||
if k.xpub == keystore.xpub:
|
||||
if k.get_master_public_key() == keystore.get_master_public_key():
|
||||
break
|
||||
else:
|
||||
self.window.show_error(_('Keystore not found in this wallet'))
|
||||
|
||||
@@ -639,6 +639,9 @@ class BIP32_KeyStore(Xpub, Deterministic_KeyStore):
|
||||
self.xpub = d.get('xpub')
|
||||
self.xprv = d.get('xprv')
|
||||
|
||||
def watching_only_keystore(self):
|
||||
return BIP32_KeyStore({'xpub':self.xpub})
|
||||
|
||||
def format_seed(self, seed):
|
||||
return ' '.join(seed.split())
|
||||
|
||||
@@ -731,6 +734,9 @@ class Old_KeyStore(MasterPublicKeyMixin, Deterministic_KeyStore):
|
||||
self.mpk = d.get('mpk')
|
||||
self._root_fingerprint = None
|
||||
|
||||
def watching_only_keystore(self):
|
||||
return Old_KeyStore({'mpk': self.mpk})
|
||||
|
||||
def get_hex_seed(self, password):
|
||||
return pw_decode(self.seed, password, version=self.pw_hash_version).encode('utf8')
|
||||
|
||||
|
||||
@@ -3965,7 +3965,7 @@ class Deterministic_Wallet(Abstract_Wallet):
|
||||
if self.storage.is_encrypted_with_hw_device():
|
||||
password = keystore.get_password_for_storage_encryption()
|
||||
self.update_password(password, None, encrypt_storage=False)
|
||||
new = BIP32_KeyStore({'xpub':keystore.xpub})
|
||||
new = keystore.watching_only_keystore()
|
||||
self._update_keystore(new)
|
||||
|
||||
|
||||
@@ -4007,7 +4007,7 @@ class Standard_Wallet(Simple_Wallet, Deterministic_Wallet):
|
||||
self.keystore.add_slip_19_ownership_proofs_to_tx(tx=tx, password=None)
|
||||
|
||||
def _update_keystore(self, keystore):
|
||||
assert self.keystore.xpub == keystore.xpub
|
||||
assert self.keystore.get_master_public_key() == keystore.get_master_public_key()
|
||||
self.keystore = keystore
|
||||
self.save_keystore()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user