What changed, and why it matters
This is a small user-experience improvement in the Electrum Bitcoin wallet's Qt desktop interface. It changes how certain wallet-loading errors are handled: instead of showing some unexpected errors to the user as a warning dialog, they are now sent to Electrum's crash reporter. It does not change how funds are stored, signed, or transmitted, and there is no indication it fixes a security vulnerability.
No urgent action. Treat as routine maintenance. Reviewers may verify that the crash reporter does not leak sensitive wallet data in reported traces, but that is outside the scope of this diff.
Security signals we found
Exception handling change during wallet loading
More unexpected errors routed to crash reporter instead of warning dialog
No cryptographic, network, or storage behavior changed
No bounds checks, input validation, or privilege changes visible
Evidence from the diff
The commit refactors exception handling in ElectrumGui.start_new_window() in electrum/gui/qt/__init__.py. It introduces a helper __handle_wallet_loading_exc() that routes UserFacingException and non-crash-report WalletFileException to a warning dialog, while all other exceptions are sent to the crash reporter. Previously, the first wallet-loading attempt only sent WalletFileException with should_report_crash=True to the reporter and showed everything else as a warning. The change broadens crash reporting to catch assertion failures and similar unexpected exceptions during daemon.load_wallet. This is a defensive hardening/UX change, not a patch for an identified exploit.
Changed components
electrum/gui/qt/__init__.pyElectrumGui.start_new_window()daemon.load_wallet error pathInspect captured patch +13 / −17
diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py
index 38a8a95..e28ebcd 100644
--- a/electrum/gui/qt/__init__.py
+++ b/electrum/gui/qt/__init__.py
@@ -368,6 +368,17 @@ class ElectrumGui(BaseElectrumGui, Logger):
self.logger.warning(f"terms of use not accepted, rejecting to start new window")
return None
+ def __handle_wallet_loading_exc(exc: Exception, pos):
+ if isinstance(exc, UserFacingException) \
+ or isinstance(exc, WalletFileException) and not exc.should_report_crash:
+ self.logger.exception(f"{pos=}")
+ custom_message_box(icon=QMessageBox.Icon.Warning,
+ parent=None,
+ title=_('Error'),
+ text=_('Cannot load wallet') + f' ({pos}):\n' + str(exc))
+ else:
+ send_exception_to_crash_reporter(exc)
+
wallet = None
# Try to open with daemon first. If this succeeds, there won't be a wizard at all
# (the wallet main window will appear directly).
@@ -385,14 +396,7 @@ class ElectrumGui(BaseElectrumGui, Logger):
except WalletUnfinished:
pass # open with wizard below
except Exception as e:
- self.logger.exception('')
- err_text = str(e) if isinstance(e, WalletFileException) else repr(e)
- custom_message_box(icon=QMessageBox.Icon.Warning,
- parent=None,
- title=_('Error'),
- text=_('Cannot load wallet') + ' (1):\n' + err_text)
- if isinstance(e, WalletFileException) and e.should_report_crash:
- send_exception_to_crash_reporter(e)
+ __handle_wallet_loading_exc(e, 1)
# if app is starting, still let wizard appear
if not app_is_starting:
return
@@ -410,15 +414,7 @@ class ElectrumGui(BaseElectrumGui, Logger):
except UserCancelled:
return
except Exception as e:
- self.logger.exception('')
- if isinstance(e, UserFacingException) \
- or isinstance(e, WalletFileException) and not e.should_report_crash:
- custom_message_box(icon=QMessageBox.Icon.Warning,
- parent=None,
- title=_('Error'),
- text=_('Cannot load wallet') + '(2) :\n' + str(e))
- else:
- send_exception_to_crash_reporter(e)
+ __handle_wallet_loading_exc(e, 2)
if app_is_starting:
# If we raise in this context, there are no more fallbacks, we will shut down.
# Worst case scenario, we might have gotten here without user interaction,
Why this scored 19/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.