qml: store current wallet when switching to already open wallet
What changed, and why it matters
This is a small bugfix in Electrum's background service (daemon). When a user switched to a wallet that was already open, the daemon forgot to update its record of which wallet is currently active. The patch makes it remember the active wallet in that case. There is no direct evidence this is a security vulnerability, but it could contribute to confused state or unexpected behavior in the wallet user interface.
Treat as a routine bugfix. Review whether inconsistent current-wallet state could cause UI-level misoperation (e.g., acting on the wrong wallet), but no immediate security response is indicated by the diff alone.
Security signals we found
State consistency fix in wallet selection logic
No input validation, cryptographic, or authorization change visible
No mention of security, CVE, bug bounty, or researcher attribution in commit
Evidence from the diff
In electrum/daemon.py, the Daemon.load_wallet() method now sets self.config.CURRENT_WALLET = path when an already-loaded wallet is returned and self.config.get(‘wallet_path’) is None. Previously this only happened for newly loaded wallets. This keeps the daemon’s notion of the current wallet consistent when switching between open wallets, particularly relevant for the QML GUI. The change is two lines and is defensive/state-correctness only.
Changed components
electrum/daemon.pyDaemon.load_wallet()QML wallet switchingInspect captured patch +2 / −0
diff --git a/electrum/daemon.py b/electrum/daemon.py
index 3afa92a..3dd4e26 100644
--- a/electrum/daemon.py
+++ b/electrum/daemon.py
@@ -499,6 +499,8 @@ class Daemon(Logger):
if wallet := self._wallets.get(wallet_key):
if force_check_password:
wallet.check_password(password)
+ if self.config.get('wallet_path') is None:
+ self.config.CURRENT_WALLET = path
return wallet
wallet = self._load_wallet(
path, password, upgrade=upgrade, config=self.config, force_check_password=force_check_password)
Why this scored 18/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.