From 130baf13c83f14061003601d5780eb60ae05f6b2 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 14 Feb 2024 08:52:23 +0000 Subject: [PATCH] trezor: show descriptive error if trying to init device without fw closes https://github.com/spesmilo/electrum/issues/8892 --- electrum/plugins/trezor/qt.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/electrum/plugins/trezor/qt.py b/electrum/plugins/trezor/qt.py index cd8c81c27..1d6716676 100644 --- a/electrum/plugins/trezor/qt.py +++ b/electrum/plugins/trezor/qt.py @@ -823,6 +823,12 @@ class WCTrezorInitMethod(WizardComponent, Logger): self.plugin = self.plugins.get_plugin(_info.plugin_name) device_id = _info.device.id_ client = self.plugins.device_manager.client_by_id(device_id, scan_now=False) + if client.features.bootloader_mode: + msg = (_("Looks like your device is in bootloader mode. Try reconnecting it.\n" + "If you haven't installed a firmware on it yet, you can download it from {}") + .format(self.plugin.firmware_URL)) + self.error = msg + return if not client.is_uptodate(): msg = (_('Outdated {} firmware for device labelled {}. Please ' 'download the updated firmware from {}') @@ -843,6 +849,8 @@ class WCTrezorInitMethod(WizardComponent, Logger): self._valid = True def apply(self): + if not self.valid: + return self.wizard_data['trezor_init'] = self.choice_w.selected_key