wallet_list optionally takes wallet_id

This commit is contained in:
Lex Berezhny 2019-09-20 16:47:49 -04:00
parent 1d090765ba
commit 1ac3b6c173

View file

@ -1047,18 +1047,20 @@ class Daemon(metaclass=JSONRPCServerType):
""" """
@requires("wallet") @requires("wallet")
def jsonrpc_wallet_list(self): def jsonrpc_wallet_list(self, wallet_id=None):
""" """
List wallets. List wallets.
Usage: Usage:
wallet_list wallet_list [--wallet_id=<wallet_id>]
Options: Options:
None --wallet_id=<wallet_id> : (str) show specific wallet only
Returns: {List[Wallet]} Returns: {List[Wallet]}
""" """
if wallet_id:
return [self.wallet_manager.get_wallet_or_error(wallet_id)]
return self.wallet_manager.wallets return self.wallet_manager.wallets
@requires("wallet") @requires("wallet")