transaction: re-raise NetworkException in add_info_from_network

`Transaction.add_info_from_network` would swallow a `NetworkException`
even when `ignore_network_issues=False` is passed.
This causes `Transaction.add_info_from_wallet_and_network` to
incorrectly return True even if the operation failed.
If `QETxRbfFeeBumper` then incorrectly proceeds assuming the call was
successful `Abstract_Wallet.bump_fee()` would raise an `Exception("tx
missing info from network")`.
Should fix the traceback in
https://github.com/spesmilo/electrum/issues/5502#issuecomment-4021308427.
This commit is contained in:
f321x
2026-03-09 13:45:19 +01:00
parent 3695e00f44
commit e8eee065a5
+3
View File
@@ -1269,6 +1269,7 @@ class Transaction:
timeout=None,
) -> None:
"""note: it is recommended to call add_info_from_wallet first, as this can save some network requests"""
from .interface import NetworkException
if not self.is_missing_info_from_network():
return
if progress_cb is None:
@@ -1302,6 +1303,8 @@ class Transaction:
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:
raise
finally:
has_finished = True
progress_cb(TxinDataFetchProgress(num_tasks_done, num_tasks_total, has_errored, has_finished))