From d3a10c422550ec863b5d9359e6286cfa48548474 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 6 Feb 2023 17:55:56 +0000 Subject: [PATCH] commands: allow cmd to launch new gui window for wallet e.g. imagine electrum Qt gui is already running, with some wallet (wallet_1) open, running `$ ./run_electrum --testnet -w ~/.electrum/testnet/wallets/wallet_2` should open a new window, for wallet_2. related https://github.com/spesmilo/electrum/issues/8188#issuecomment-1419444675 --- electrum/daemon.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/electrum/daemon.py b/electrum/daemon.py index 148f63988..b0d04f40c 100644 --- a/electrum/daemon.py +++ b/electrum/daemon.py @@ -305,9 +305,12 @@ class CommandsServer(AuthenticatedServer): return True async def gui(self, config_options): + # note: "config_options" is coming from the short-lived CLI-invocation, + # while self.config is the config of the long-lived daemon process. + # "config_options" should have priority. if self.daemon.gui_object: if hasattr(self.daemon.gui_object, 'new_window'): - path = self.config.get_wallet_path(use_gui_last_wallet=True) + 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')) response = "ok" else: