AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 19 Bitcoin

wizard: fix exception when loading new tc wallet

Public commit record

What the developer wrote

Authored by f321x

88/100 · Strong
wizard: fix exception when loading new tc wallet

I tried to reproduce:
https://github.com/spesmilo/electrum/issues/8815#issuecomment-2094259186
which triggered the following exception for me:

```
Traceback (most recent call last):
File "/home/user/code/electrum-fork/electrum/gui/qt/__init__.py", line 409, in start_new_window
window = self._create_window_for_wallet(wallet)
File "/home/user/code/electrum-fork/electrum/gui/qt/__init__.py", line 329, in _create_window_for_wallet
w = ElectrumWindow(self, wallet)
File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 290, in __init__
self.load_wallet(wallet)
~~~~~~~~~~~~~~~~^^^^^^^^
File "/home/user/code/electrum-fork/electrum/util.py", line 495, in do_profile
o = func(*args, **kw_args)
File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 589, in load_wallet
self.update_recently_opened_menu()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 741, in update_recently_opened_menu
for i, k in enumerate(recent):
~~~~~~~~~^^^^^^^^
TypeError: 'NoneType' object is not iterable
```

This happens because the trustedcoin wallet is loaded outside of
Daemon.load_wallet() so Daemon.update_recently_opened_wallets()
is not getting called and config.RECENTLY:_OPEN_WALLET_FILES is
still None when we try to iterate through it.
As fix i now use load_wallet() instead of manually
instantiating the Wallet
and additionally handle
RECENTLY_OPEN_WALLET_FILES being None in
ElectrumWindow.update_recently_opened_menu().

My pull request https://github.com/spesmilo/electrum/pull/10121
would have sent this exception to the crash reporter so we
might have noticed it earlier. I think we should not just catch
all exceptions in the wizard like on master as it causes us to
repeatedly miss regressions in the wizard that could be sent to
the crash reporter.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a crash that occurred when creating or loading a special type of Electrum wallet (a trustedcoin two-factor wallet) through the setup wizard. The crash was caused by the wallet being loaded in a way that skipped normal bookkeeping, leaving a menu list as 'None' instead of empty. The fix makes the wizard use the standard wallet-loading path and also defensively treats a missing recent-wallets list as empty. It is a bug-fix for a user-visible crash, not a security vulnerability.

Recommended action

No security action required; treat as a normal stability bug fix. Users on affected versions may experience a crash when setting up a trustedcoin wallet, so updating is advisable for reliability.

Security signals we found

01

No security-relevant signals present

02

Crash/DoS-like symptom (unhandled TypeError) fixed

03

Code path normalization (using standard load_wallet instead of manual instantiation)

Risk score

Why this scored 19/100

Our methodology →
Potential impact 2/30
Exploitability 0/25
Stealth signal 1/15
Affected reach 3/15
Confidence 9/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.