@ -2208,10 +2208,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
badkeys = []
addrlist = []
for key in text:
addr = self.wallet.import_key(key, password)
try:
except Exception as e:
except BaseException as e:
badkeys.append(key)
continue
if not addr:
@ -368,7 +368,7 @@ class Commands:
addr = self.wallet.import_key(privkey, self._password)
out = "Keypair imported: " + addr
out = "Error: " + str(e)
return out
@ -115,7 +115,9 @@ class Imported_KeyStore(Software_KeyStore):
pubkey = public_key_from_private_key(sec)
except Exception:
raise Exception('Invalid private key')
raise BaseException('Invalid private key')
if pubkey in self.keypairs:
raise BaseException('Private key already in keystore')
self.keypairs[pubkey] = sec
return pubkey