commands/jsonrpc: fix specifying "wallet" to commands that need it

This commit is contained in:
SomberNight 2019-12-21 07:00:30 +01:00
parent 2ca535225d
commit ad5c6284c4
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -106,7 +106,8 @@ def command(s):
daemon = cmd_runner.daemon
if daemon:
if (cmd.requires_wallet or 'wallet_path' in cmd.options) and kwargs.get('wallet_path') is None:
kwargs['wallet_path'] = daemon.config.get_wallet_path()
# using JSON-RPC, sometimes the "wallet" kwarg needs to be used to specify a wallet
kwargs['wallet_path'] = kwargs.pop('wallet', None) or daemon.config.get_wallet_path()
if cmd.requires_wallet:
wallet_path = kwargs.pop('wallet_path')
wallet = daemon.get_wallet(wallet_path)