What changed, and why it matters
This commit is a small code cleanup in Electrum's wallet setup wizard. It removes a duplicate copy of the rules used to check whether a recovery seed is valid and instead reuses an existing method. There is no indication this fixes a security bug; it is a maintenance change to keep the two copies of the rules from diverging in the future.
No security action required. Treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change refactors WCHaveSeed.is_seed() in electrum/gui/qt/wizard/wallet.py. Previously it duplicated the logic from KeystoreWizard.validate_seed() for electrum seeds, including wallet-type-specific handling of 2FA and multisig seed types. The patch replaces that duplicated logic with a call to self.wizard.validate_seed(x, ‘electrum’, self.wizard_data[‘wallet_type’])[0], guarded by an assertion that the seed type is ‘electrum’. Net -6 lines, no functional change intended.
Changed components
electrum/gui/qt/wizard/wallet.pyInspect captured patch +2 / −8
### electrum/gui/qt/wizard/wallet.py
@@ -620,14 +620,8 @@ def seed_valid_changed(valid):
def is_seed(self, x):
# really only used for electrum seeds. bip39 and slip39 are validated in SeedWidget
- t = mnemonic.calc_seed_type(x)
- if self.wizard_data['wallet_type'] == 'standard':
- return mnemonic.is_seed(x) and (self.wizard.supports_2fa() or not mnemonic.is_any_2fa_seed_type(t))
- elif self.wizard_data['wallet_type'] == '2fa':
- return mnemonic.is_any_2fa_seed_type(t)
- else:
- # multisig? by default, only accept modern non-2fa electrum seeds
- return t in ['standard', 'segwit']
+ assert self.seed_widget.seed_type == 'electrum', self.seed_widget.seed_type
+ return self.wizard.validate_seed(x, 'electrum', self.wizard_data['wallet_type'])[0]
def validate(self):
# precond: only call when SeedWidget deems seed a valid seedWhy this scored 12/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.