fix #2524: add proper error message

This commit is contained in:
ThomasV 2017-06-30 12:20:19 +02:00
parent 828b0e5d70
commit 298461aee2
1 changed files with 2 additions and 0 deletions

View File

@ -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