commit 7a1af24eda848e025c8f830ace77065d898db67f
parent 5661aabaa4e6f60a733b549ad11e9017be5a9f19
Author: ThomasV <thomasv@electrum.org>
Date: Sat, 11 Jun 2016 16:55:19 +0200
getprivatekeys: try load_json if we did not get an address
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git 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):