Skip to content

Commit fb0c301

Browse files
committed
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.
1 parent 6cf663a commit fb0c301

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

electrum/commands.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ async def func_wrapper(*args, **kwargs):
163163
cmd = known_commands[name] # type: Command
164164
password = kwargs.get('password')
165165
daemon = cmd_runner.daemon
166+
if isinstance(kwargs.get('wallet'), str):
167+
# a wallet path has been passed as 'wallet' arg (instead of 'wallet_path')
168+
wallet_str = kwargs.pop('wallet')
169+
# still prioritize 'wallet_path' over a 'wallet' str
170+
if not 'wallet_path' in kwargs:
171+
kwargs['wallet_path'] = wallet_str
166172
if daemon:
167173
if 'wallet_path' in cmd.options or cmd.requires_wallet:
168174
kwargs['wallet_path'] = daemon.config.maybe_complete_wallet_path(kwargs.get('wallet_path'))

0 commit comments

Comments
 (0)