daemon: reset CURRENT_WALLET if the wallet gets deleted
What changed, and why it matters
This is a small bug-fix patch. When a user deletes a wallet, Electrum now clears its 'remembered last wallet' setting so the app doesn't try to reopen the deleted wallet on next launch and show an error message. It is a user-experience fix, not a security vulnerability.
No security action required; treat as routine bug fix.
Security signals we found
No security-relevant signals detected
Change addresses a stale-config UX issue, not a vulnerability
Evidence from the diff
In electrum/daemon.py, the wallet deletion method now sets self.config.CURRENT_WALLET to None when the deleted wallet path matches the currently remembered wallet. This prevents the QML GUI from attempting to load a non-existent wallet at startup. The change is purely defensive against a stale configuration value.
Changed components
electrum/daemon.pySimpleConfig.CURRENT_WALLET settingInspect captured patch +2 / −0
diff --git a/electrum/daemon.py b/electrum/daemon.py
index b1ab1e8..9c5c9d2 100644
--- a/electrum/daemon.py
+++ b/electrum/daemon.py
@@ -562,6 +562,8 @@ class Daemon(Logger):
if os.path.exists(path):
os.unlink(path)
self.update_recently_opened_wallets(path, remove=True)
+ if self.config.CURRENT_WALLET == path:
+ self.config.CURRENT_WALLET = None
return True
return False
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.