Merge pull request #10980 from spesmilo/add_input_from_network_do_not_ignore_exceptions
What changed, and why it matters
This is a one-line bugfix in Electrum's transaction handling. Previously, the code accidentally swallowed (hid) almost all exceptions when fetching extra transaction data from the network, only re-raising errors that were both network-related and not set to be ignored. After the fix, any unexpected error is re-raised so it can be handled or reported properly. The change improves reliability and error visibility, but the diff alone does not show an active security vulnerability being exploited.
Treat as a routine reliability/defensive fix. Review whether silently swallowed exceptions in past versions could have led to incomplete transaction data being used, and ensure callers set ignore_network_issues appropriately. No emergency response is indicated by the diff alone.
Security signals we found
Exception swallowing bug fixed
Network/transaction input enrichment logic changed
Silent failure mode removed
Evidence from the diff
In electrum/transaction.py, the add_info_to_txin() helper wraps network lookups in a try/except. The original condition if isinstance(e, NetworkException) and not ignore_network_issues: raise meant non-NetworkException errors were always swallowed, and even NetworkException errors were swallowed when ignore_network_issues was True. The corrected condition if not (isinstance(e, NetworkException) and ignore_network_issues): raise re-raises every exception except the specific case of a network problem the caller asked to ignore. This prevents silent failures during transaction input enrichment.
Changed components
electrum/transaction.pyadd_info_to_txin()add_info_from_network()Inspect captured patch +1 / −1
### 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 = TrueWhy this scored 42/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.