From 7a1af24eda848e025c8f830ace77065d898db67f Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sat, 11 Jun 2016 16:55:19 +0200 Subject: [PATCH] getprivatekeys: try load_json if we did not get an address --- lib/commands.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/commands.py b/lib/commands.py index d4f9b2ed9..84dee5fc9 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -272,10 +272,10 @@ class Commands: @command('wp') def getprivatekeys(self, address): """Get private keys of addresses. You may pass a single wallet address, or a list of wallet addresses.""" - is_list = type(address) is list - domain = address if is_list else [address] - out = [self.wallet.get_private_key(address, self._password) for address in domain] - return out if is_list else out[0] + if is_address(address): + return self.wallet.get_private_key(address, self._password) + domain = json_loads(address) + return [self.wallet.get_private_key(address, self._password) for address in domain] @command('w') def ismine(self, address):