From 0de62165600b4d3eb8fa0e668bfafea21868a8a8 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Thu, 3 Aug 2023 14:39:15 +0200 Subject: [PATCH] qt: have_seed and create_seed support 2fa --- electrum/gui/qt/wizard/wallet.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qt/wizard/wallet.py b/electrum/gui/qt/wizard/wallet.py index 0509890fb..c1bba473e 100644 --- a/electrum/gui/qt/wizard/wallet.py +++ b/electrum/gui/qt/wizard/wallet.py @@ -307,6 +307,8 @@ class WCCreateSeed(WizardComponent): self.seed = None def on_ready(self): + if self.wizard_data['wallet_type'] == '2fa': + self.seed_type = '2fa_segwit' QTimer.singleShot(1, self.create_seed) def apply(self): @@ -475,6 +477,8 @@ class WCHaveSeed(WizardComponent): def is_seed(self, x): if self.wizard_data['wallet_type'] == 'standard': return mnemonic.is_seed(x) + elif self.wizard_data['wallet_type'] == '2fa': + return mnemonic.seed_type(x) in ['2fa', '2fa_segwit'] else: return mnemonic.seed_type(x) in ['standard', 'segwit'] @@ -485,8 +489,10 @@ class WCHaveSeed(WizardComponent): wallet_type = self.wizard_data['wallet_type'] seed_valid, seed_type, validation_message = self.wizard.validate_seed(seed, seed_variant, wallet_type) - if not seed_valid: - self.valid = False + is_cosigner = self.wizard_data['wallet_type'] == 'multisig' and 'multisig_current_cosigner' in self.wizard_data + + if not is_cosigner or not seed_valid: + self.valid = seed_valid return if seed_type in ['bip39', 'slip39'] or self.slayout.is_ext: