electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit a3e1b2e00c04b72e7375b121f094d34e721fe6ed
parent 4b1d8353040513f6a3e371b7385711eb9f146a70
Author: SomberNight <somber.night@protonmail.com>
Date:   Thu,  9 Apr 2020 19:04:52 +0200

wizard: hww creation flow: don't just swallow exception

if we just return here, the calling code will try to create the storage and fail

Diffstat:
Melectrum/base_wizard.py | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/electrum/base_wizard.py b/electrum/base_wizard.py @@ -263,7 +263,7 @@ class BaseWizard(Logger): k = keystore.from_master_key(text) self.on_keystore(k) - def choose_hw_device(self, purpose=HWD_SETUP_NEW_WALLET, *, storage=None): + def choose_hw_device(self, purpose=HWD_SETUP_NEW_WALLET, *, storage: WalletStorage = None): title = _('Hardware Keystore') # check available plugins supported_plugins = self.plugins.get_hardware_support() @@ -343,7 +343,7 @@ class BaseWizard(Logger): self.choice_dialog(title=title, message=msg, choices=choices, run_next=lambda *args: self.on_device(*args, purpose=purpose, storage=storage)) - def on_device(self, name, device_info: 'DeviceInfo', *, purpose, storage=None): + def on_device(self, name, device_info: 'DeviceInfo', *, purpose, storage: WalletStorage = None): self.plugin = self.plugins.get_plugin(name) assert isinstance(self.plugin, HW_PluginBase) devmgr = self.plugins.device_manager @@ -444,6 +444,7 @@ class BaseWizard(Logger): except BaseException as e: self.logger.exception('') self.show_error(e) + self.choose_hw_device() return d = { 'type': 'hardware', @@ -565,6 +566,7 @@ class BaseWizard(Logger): except BaseException as e: self.logger.exception('') self.show_error(str(e)) + self.choose_hw_device() return self.request_storage_encryption( run_next=lambda encrypt_storage: self.on_password(