diff --git a/electrum/address_synchronizer.py b/electrum/address_synchronizer.py index 413409b84..1d559a762 100644 --- a/electrum/address_synchronizer.py +++ b/electrum/address_synchronizer.py @@ -31,7 +31,7 @@ from .crypto import sha256 from . import bitcoin, util from .bitcoin import COINBASE_MATURITY from .util import profiler, bfh, TxMinedInfo, UnrelatedTransactionException, with_lock, OldTaskGroup -from .transaction import Transaction, TxOutput, TxInput, PartialTxInput, TxOutpoint, PartialTransaction +from .transaction import Transaction, TxOutput, TxInput, PartialTxInput, TxOutpoint, PartialTransaction, tx_from_any from .synchronizer import Synchronizer from .verifier import SPV from .blockchain import hash_header, Blockchain @@ -275,6 +275,8 @@ class AddressSynchronizer(Logger, EventListener): tx_hash = tx.txid() if tx_hash is None: raise Exception("cannot add tx without txid to wallet history") + # For sanity, try to serialize and deserialize tx early: + tx_from_any(str(tx)) # see if raises (no-side-effects) # we need self.transaction_lock but get_tx_height will take self.lock # so we need to take that too here, to enforce order of locks with self.lock, self.transaction_lock: