From 3f67b21be72ac7b6199429b22acd464b1daa0e4b Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 18 Sep 2026 16:36:52 +0200 Subject: [PATCH] add_info_from_network: do not swallow exceptions An attacker can provide a witness_utxo whose value disagrees with the real previous transaction. That would raise PSBTInputConsistencyFailure, which is swallowed because it is not a NetworkException. This would lead us to sign a tx with the wrong input amount. (no fund loss: the tx is invalid under BIP143) --- electrum/transaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electrum/transaction.py b/electrum/transaction.py index 2fbd71c7e69..f3780b8c849 100644 --- a/electrum/transaction.py +++ b/electrum/transaction.py @@ -1302,7 +1302,7 @@ async def add_info_to_txin(txin: TxInput): except Exception as e: has_errored = True _logger.error(f"tx.add_info_from_network() got exc: {e!r}") - if isinstance(e, NetworkException) and not ignore_network_issues: + if not (isinstance(e, NetworkException) and ignore_network_issues): raise finally: has_finished = True