Browse Source

fix #2524: add proper error message

2.9.x
ThomasV 8 years ago
parent
commit
298461aee2
  1. 2
      lib/commands.py

2
lib/commands.py

@ -361,6 +361,8 @@ class Commands:
@command('wp')
def importprivkey(self, privkey):
"""Import a private key. """
if not self.wallet.can_import_privkey():
return "Error: This type of wallet cannot import private keys. Try to create a new wallet with that key."
try:
addr = self.wallet.import_key(privkey, self._password)
out = "Keypair imported: " + addr

Loading…
Cancel
Save