1
0

hww: distinguish devices based on "soft device id" (not just labels)

fixes #5759
This commit is contained in:
SomberNight
2020-04-08 14:43:01 +02:00
parent 7dabbdd082
commit 9d0bb295e6
8 changed files with 50 additions and 6 deletions

View File

@@ -724,6 +724,7 @@ class Hardware_KeyStore(Xpub, KeyStore):
# device reconnects
self.xpub = d.get('xpub')
self.label = d.get('label')
self.soft_device_id = d.get('soft_device_id') # type: Optional[str]
self.handler = None # type: Optional[HardwareHandlerBase]
run_hook('init_keystore', self)
@@ -747,6 +748,7 @@ class Hardware_KeyStore(Xpub, KeyStore):
'derivation': self.get_derivation_prefix(),
'root_fingerprint': self.get_root_fingerprint(),
'label':self.label,
'soft_device_id': self.soft_device_id,
}
def unpaired(self):
@@ -788,6 +790,9 @@ class Hardware_KeyStore(Xpub, KeyStore):
if self.label != client.label():
self.label = client.label()
self.is_requesting_to_be_rewritten_to_wallet_file = True
if self.soft_device_id != client.get_soft_device_id():
self.soft_device_id = client.get_soft_device_id()
self.is_requesting_to_be_rewritten_to_wallet_file = True
KeyStoreWithMPK = Union[KeyStore, MasterPublicKeyMixin] # intersection really...