electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 32dee14fd0863c8da148b0c737896fb71365d753
parent 01736197f85593b0616093608f630c052fd53779
Author: ThomasV <thomasv@electrum.org>
Date:   Fri, 25 Aug 2017 09:27:40 +0200

show error message when parsing empty tx

Diffstat:
Mgui/qt/main_window.py | 5++---
Mlib/transaction.py | 2++
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -2018,9 +2018,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): try: tx = tx_from_str(txt) return Transaction(tx) - except: - traceback.print_exc(file=sys.stdout) - self.show_critical(_("Electrum was unable to parse your transaction")) + except BaseException as e: + self.show_critical(_("Electrum was unable to parse your transaction") + ":\n" + str(e)) return def read_tx_from_qrcode(self): diff --git a/lib/transaction.py b/lib/transaction.py @@ -896,6 +896,8 @@ def tx_from_str(txt): "json or raw hexadecimal" import json txt = txt.strip() + if not txt: + raise ValueError("empty string") try: bfh(txt) is_hex = True