fix #2524: add proper error message
This commit is contained in:
parent
828b0e5d70
commit
298461aee2
|
@ -361,6 +361,8 @@ class Commands:
|
||||||
@command('wp')
|
@command('wp')
|
||||||
def importprivkey(self, privkey):
|
def importprivkey(self, privkey):
|
||||||
"""Import a private key. """
|
"""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:
|
try:
|
||||||
addr = self.wallet.import_key(privkey, self._password)
|
addr = self.wallet.import_key(privkey, self._password)
|
||||||
out = "Keypair imported: " + addr
|
out = "Keypair imported: " + addr
|
||||||
|
|
Loading…
Reference in New Issue