From c81d565665b583beaba8b74af0c5594cfd270373 Mon Sep 17 00:00:00 2001 From: ecdsa Date: Sun, 5 May 2013 17:38:59 +0200 Subject: [PATCH] add error message for import_key failure --- lib/wallet.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/wallet.py b/lib/wallet.py index 8ccd67afa..189fa1091 100644 --- 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')