From 2c6cf7f80cda5ee78fa1b8d670ae53de169b99f9 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sat, 10 Mar 2018 08:00:41 +0100 Subject: [PATCH] careful with exceptions.. --- lib/wallet.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/wallet.py b/lib/wallet.py index 0d87d715b..9f4f2baa9 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -1939,14 +1939,15 @@ class Imported_Wallet(Simple_Wallet): try: txin_type, pubkey = self.keystore.import_privkey(sec, pw) except Exception: - raise BaseException('Invalid private key', sec) + neutered_privkey = str(sec)[:3] + '..' + str(sec)[-2:] + raise BaseException('Invalid private key', neutered_privkey) if txin_type in ['p2pkh', 'p2wpkh', 'p2wpkh-p2sh']: if redeem_script is not None: - raise BaseException('Cannot use redeem script with', txin_type, sec) + raise BaseException('Cannot use redeem script with', txin_type) addr = bitcoin.pubkey_to_address(txin_type, pubkey) elif txin_type in ['p2sh', 'p2wsh', 'p2wsh-p2sh']: if redeem_script is None: - raise BaseException('Redeem script required for', txin_type, sec) + raise BaseException('Redeem script required for', txin_type) addr = bitcoin.redeem_script_to_address(txin_type, redeem_script) else: raise NotImplementedError(txin_type)