Browse Source

bitbox02: implement get_soft_device_id so multisig runs more smoothly

Without it, if you have say a 1-of-2 multisig with two BitBox02s, you
would run into trouble if the first keystore would try to match to the
wrong inserted BitBox02 (wrong order, or the first one is not
inserted, etc. ).

With the soft device id, the device manager can figure it on its own
which keystore belongs to which connected bb02.
bip39-recovery
Marko Bencun 5 years ago
parent
commit
106688ea54
No known key found for this signature in database GPG Key ID: 804538928C37EAE8
  1. 9
      electrum/plugins/bitbox02/bitbox02.py

9
electrum/plugins/bitbox02/bitbox02.py

@ -85,6 +85,15 @@ class BitBox02Client(HardwareClientBase):
return False
return True
def get_soft_device_id(self) -> Optional[str]:
if self.handler is None:
# Can't do the pairing without the handler. This happens at wallet creation time, when
# listing the devices.
return None
if self.bitbox02_device is None:
self.pairing_dialog(wizard=False)
return self.bitbox02_device.root_fingerprint().hex()
def pairing_dialog(self, wizard: bool = True):
def pairing_step(code: str, device_response: Callable[[], bool]) -> bool:
msg = "Please compare and confirm the pairing code on your BitBox02:\n" + code

Loading…
Cancel
Save