commit c81d565665b583beaba8b74af0c5594cfd270373
parent 0f661aa3a137f925e6f436c56c38711b1de6d17d
Author: ecdsa <ecdsa@github>
Date: Sun, 5 May 2013 17:38:59 +0200
add error message for import_key failure
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -137,7 +137,10 @@ class Wallet:
def import_key(self, sec, password):
# check 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):
raise BaseException('Address already in wallet')