1
0

wizard: fix regression: allow passphrase for some '2fa' seeds

fixes https://github.com/spesmilo/electrum/issues/9088
This commit is contained in:
SomberNight
2024-06-10 19:35:56 +00:00
parent 4f7dcc98bd
commit b95fbbb86f
3 changed files with 39 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ from electrum.storage import WalletStorage, StorageEncryptionVersion
from electrum.wallet_db import WalletDB
from electrum.bip32 import normalize_bip32_derivation, xpub_type
from electrum import keystore, mnemonic, bitcoin
from electrum.mnemonic import is_any_2fa_seed_type
from electrum.mnemonic import is_any_2fa_seed_type, can_seed_have_passphrase
if TYPE_CHECKING:
from electrum.daemon import Daemon
@@ -492,8 +492,7 @@ class NewWalletWizard(AbstractWizard):
seed_type = mnemonic.seed_type(seed)
if seed_type != '':
seed_valid = True
if seed_type in ['old', '2fa']:
can_passphrase = False
can_passphrase = can_seed_have_passphrase(seed)
elif seed_variant == 'bip39':
is_checksum, is_wordlist = keystore.bip39_is_checksum_valid(seed)
validation_message = ('' if is_checksum else _('BIP39 checksum failed')) if is_wordlist else _('Unknown BIP39 wordlist')