show error message when parsing empty tx
This commit is contained in:
@@ -2018,9 +2018,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
|||||||
try:
|
try:
|
||||||
tx = tx_from_str(txt)
|
tx = tx_from_str(txt)
|
||||||
return Transaction(tx)
|
return Transaction(tx)
|
||||||
except:
|
except BaseException as e:
|
||||||
traceback.print_exc(file=sys.stdout)
|
self.show_critical(_("Electrum was unable to parse your transaction") + ":\n" + str(e))
|
||||||
self.show_critical(_("Electrum was unable to parse your transaction"))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def read_tx_from_qrcode(self):
|
def read_tx_from_qrcode(self):
|
||||||
|
|||||||
@@ -896,6 +896,8 @@ def tx_from_str(txt):
|
|||||||
"json or raw hexadecimal"
|
"json or raw hexadecimal"
|
||||||
import json
|
import json
|
||||||
txt = txt.strip()
|
txt = txt.strip()
|
||||||
|
if not txt:
|
||||||
|
raise ValueError("empty string")
|
||||||
try:
|
try:
|
||||||
bfh(txt)
|
bfh(txt)
|
||||||
is_hex = True
|
is_hex = True
|
||||||
|
|||||||
Reference in New Issue
Block a user