trampoline: when sending payment, log "is_legacy" (e2e vs pay2legacy)
What changed, and why it matters
This commit only adds extra information to log messages when Electrum sends a Lightning payment. It does not change any payment logic, permissions, or security behavior. One log line now includes the payment hash, and another debug log records whether the payment uses a legacy trampoline relay. There is no security issue visible in the diff.
No action required. The change is diagnostic logging only and does not introduce a security vulnerability.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch is purely additive logging in two files. In lnworker.py, the existing payment route log line is extended to include payment_hash.hex(). In trampoline.py, a new _logger.debug() call records invoice_pubkey and the boolean is_legacy returned by is_legacy_relay(). No functional code paths, validation, cryptography, or network behavior are modified.
Changed components
electrum/lnworker.pyelectrum/trampoline.pyInspect captured patch +2 / −1
diff --git a/electrum/lnworker.py b/electrum/lnworker.py
index ace1a1a..b0850c0 100644
--- a/electrum/lnworker.py
+++ b/electrum/lnworker.py
@@ -3716,7 +3716,7 @@ class LNWallet(LNWorker):
total_msat=total_msat,
payment_secret=payment_secret)
num_hops = len(hops_data)
- self.logger.info(f"pay len(route)={len(route)}")
+ self.logger.info(f"pay len(route)={len(route)}. for payment_hash={payment_hash.hex()}")
for i in range(len(route)):
self.logger.info(f" {i}: edge={route[i].short_channel_id} hop_data={hops_data[i]!r}")
assert final_cltv_abs <= cltv_abs, (final_cltv_abs, cltv_abs)
diff --git a/electrum/trampoline.py b/electrum/trampoline.py
index fdf1b2d..53365fc 100644
--- a/electrum/trampoline.py
+++ b/electrum/trampoline.py
@@ -222,6 +222,7 @@ def create_trampoline_route(
) -> LNPaymentTRoute:
# we decide whether to convert to a legacy payment
is_legacy, invoice_trampolines = is_legacy_relay(invoice_features, r_tags)
+ _logger.debug(f"Creating trampoline route for invoice_pubkey={invoice_pubkey.hex()}, {is_legacy=}")
# we build a route of trampoline hops and extend the route list in place
route = []
Why this scored 15/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.