make tx deserialization more robust to ill-formed tx
This commit is contained in:
@@ -2119,17 +2119,25 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||
return self.tx_from_text(file_content)
|
||||
|
||||
def do_process_from_text(self):
|
||||
from electrum.transaction import SerializationError
|
||||
text = text_dialog(self, _('Input raw transaction'), _("Transaction:"), _("Load transaction"))
|
||||
if not text:
|
||||
return
|
||||
tx = self.tx_from_text(text)
|
||||
if tx:
|
||||
self.show_transaction(tx)
|
||||
try:
|
||||
tx = self.tx_from_text(text)
|
||||
if tx:
|
||||
self.show_transaction(tx)
|
||||
except SerializationError as e:
|
||||
self.show_critical(_("Electrum was unable to deserialize the transaction:") + "\n" + str(e))
|
||||
|
||||
def do_process_from_file(self):
|
||||
tx = self.read_tx_from_file()
|
||||
if tx:
|
||||
self.show_transaction(tx)
|
||||
from electrum.transaction import SerializationError
|
||||
try:
|
||||
tx = self.read_tx_from_file()
|
||||
if tx:
|
||||
self.show_transaction(tx)
|
||||
except SerializationError as e:
|
||||
self.show_critical(_("Electrum was unable to deserialize the transaction:") + "\n" + str(e))
|
||||
|
||||
def do_process_from_txid(self):
|
||||
from electrum import transaction
|
||||
|
||||
Reference in New Issue
Block a user