Files
pallectrum/electrum/address_synchronizer.py
SomberNight 838490fea4 adb.add_transaction: try to ser-deser tx early
Previously calling add_transaction with a malformed Transaction obj could
result in an exception late in the flow, after the walletdb was already side-effected.
Rollback of such side-effects is not implemented :/
  but this small patch should at least cover and prevent some common cases.

```
File "/opt/electrum/electrum/address_synchronizer.py", line 358, in add_transaction
  self.db.add_transaction(tx_hash, tx)
File "/opt/electrum/electrum/json_db.py", line 42, in wrapper
  return func(self, *args, **kwargs)
File "/opt/electrum/electrum/wallet_db.py", line 1434, in add_transaction
  tx = tx_from_any(str(tx))
File "/opt/electrum/electrum/transaction.py", line 1339, in tx_from_any
  raise SerializationError(f"Failed to recognise tx encoding, or to parse transaction. "
```
2025-01-10 12:24:26 +00:00

44 KiB