add error message for import_key failure
This commit is contained in:
parent
0f661aa3a1
commit
c81d565665
|
@ -137,7 +137,10 @@ class Wallet:
|
||||||
def import_key(self, sec, password):
|
def import_key(self, sec, password):
|
||||||
# check password
|
# check password
|
||||||
seed = self.decode_seed(password)
|
seed = self.decode_seed(password)
|
||||||
address = address_from_private_key(sec)
|
try:
|
||||||
|
address = address_from_private_key(sec)
|
||||||
|
except:
|
||||||
|
raise BaseException('Invalid private key')
|
||||||
|
|
||||||
if self.is_mine(address):
|
if self.is_mine(address):
|
||||||
raise BaseException('Address already in wallet')
|
raise BaseException('Address already in wallet')
|
||||||
|
|
Loading…
Reference in New Issue