From 00005ecfee5098c37a4b54748457dc73d43c40b2 Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 4 Aug 2025 12:36:12 +0200 Subject: [PATCH] rpc: handle passing wallet path as 'wallet' argument handles passing the wallet path as 'wallet' argument instead of 'wallet_path'. This did work in 4.5.8 and fails in 4.6.0 as the wallet path string will get passed directly to the command instead of the required wallet object, causing an exception when methods are called on the str. --- electrum/commands.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/electrum/commands.py b/electrum/commands.py index 40da49d5331a..59636f90e5a2 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -163,6 +163,12 @@ async def func_wrapper(*args, **kwargs): cmd = known_commands[name] # type: Command password = kwargs.get('password') daemon = cmd_runner.daemon + if isinstance(kwargs.get('wallet'), str): + # a wallet path has been passed as 'wallet' arg (instead of 'wallet_path') + wallet_str = kwargs.pop('wallet') + # still prioritize 'wallet_path' over a 'wallet' str + if 'wallet_path' not in kwargs: + kwargs['wallet_path'] = wallet_str if daemon: if 'wallet_path' in cmd.options or cmd.requires_wallet: kwargs['wallet_path'] = daemon.config.maybe_complete_wallet_path(kwargs.get('wallet_path'))