From 536fce3f944f2daac4779bb39449053a110cf3ef Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 18 Mar 2025 19:33:24 +0000 Subject: [PATCH] cli: don't add wallet to running online GUI, if called with -o --- electrum/daemon.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/electrum/daemon.py b/electrum/daemon.py index 51eb25418..6fce7eeb0 100644 --- a/electrum/daemon.py +++ b/electrum/daemon.py @@ -339,6 +339,9 @@ class CommandsServer(AuthenticatedServer): # "config_options" should have priority. if self.daemon.gui_object: if hasattr(self.daemon.gui_object, 'new_window'): + if config_options.get(SimpleConfig.NETWORK_OFFLINE.key()) and not self.config.NETWORK_OFFLINE: + raise UserFacingException( + "error: current GUI is running online, so it cannot open a new wallet offline.") path = config_options.get('wallet_path') or self.config.get_wallet_path(use_gui_last_wallet=True) self.daemon.gui_object.new_window(path, config_options.get('url')) return True