1
0
This commit is contained in:
ThomasV
2025-05-28 10:42:59 +02:00
parent 49d2f87dcf
commit b110179409
3 changed files with 9 additions and 3 deletions

View File

@@ -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'))

View File

@@ -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')

View File

@@ -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()