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):
|
||||
# check password
|
||||
seed = self.decode_seed(password)
|
||||
try:
|
||||
address = address_from_private_key(sec)
|
||||
except:
|
||||
raise BaseException('Invalid private key')
|
||||
|
||||
if self.is_mine(address):
|
||||
raise BaseException('Address already in wallet')
|
||||
|
|
Loading…
Reference in New Issue