From 1c41bd23b788b0e66af6aeb5f91537312e559c85 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 16 May 2025 15:49:54 +0000 Subject: [PATCH] network: broadcast_transaction: log full raw tx on errors --- electrum/network.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/electrum/network.py b/electrum/network.py index f03170c8a..1acc7e7f9 100644 --- a/electrum/network.py +++ b/electrum/network.py @@ -1094,15 +1094,15 @@ class Network(Logger, NetworkRetryManager[ServerAddr]): except (RequestTimedOut, asyncio.CancelledError, asyncio.TimeoutError): raise # pass-through except aiorpcx.jsonrpc.CodeMessageError as e: - self.logger.info(f"broadcast_transaction error [DO NOT TRUST THIS MESSAGE]: {error_text_str_to_safe_str(repr(e))}") + self.logger.info(f"broadcast_transaction error [DO NOT TRUST THIS MESSAGE]: {error_text_str_to_safe_str(repr(e))}. tx={str(tx)}") raise TxBroadcastServerReturnedError(self.sanitize_tx_broadcast_response(e.message)) from e except BaseException as e: # intentional BaseException for sanity! - self.logger.info(f"broadcast_transaction error2 [DO NOT TRUST THIS MESSAGE]: {error_text_str_to_safe_str(repr(e))}") + self.logger.info(f"broadcast_transaction error2 [DO NOT TRUST THIS MESSAGE]: {error_text_str_to_safe_str(repr(e))}. tx={str(tx)}") send_exception_to_crash_reporter(e) raise TxBroadcastUnknownError() from e if out != tx.txid(): self.logger.info(f"unexpected txid for broadcast_transaction [DO NOT TRUST THIS MESSAGE]: " - f"{error_text_str_to_safe_str(out)} != {tx.txid()}") + f"{error_text_str_to_safe_str(out)} != {tx.txid()}. tx={str(tx)}") raise TxBroadcastHashMismatch(_("Server returned unexpected transaction ID.")) async def try_broadcasting(self, tx, name) -> bool: