ln: improve error message for blinded trampoline check failure
What changed, and why it matters
This commit only changes the text of an error message. It does not alter any logic, checks, or behavior. The old message was misleading because it suggested a validation failure, while the actual failure is an arithmetic underflow when calculating the next hop's amount or timelock. The new message describes the real cause more accurately.
No security action needed. Treat as a normal code-quality/diagnostic improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In lightning/src/ln/onion_payment.rs, the error string returned when a blinded trampoline forward calculation fails is updated from ‘Trampoline blinded forward amt or CLTV values exceeded the outer onion’s’ to ‘Underflow calculating outbound amount or cltv value for blinded trampoline forward’. The surrounding code, failure reason enum, and secrets handling are unchanged. This is a diagnostic/message-only change.
Changed components
lightning/src/ln/onion_payment.rsInspect captured patch +1 / −1
diff --git a/lightning/src/ln/onion_payment.rs b/lightning/src/ln/onion_payment.rs
index aeeabf9..1abe433 100644
--- a/lightning/src/ln/onion_payment.rs
+++ b/lightning/src/ln/onion_payment.rs
@@ -649,7 +649,7 @@ where
) {
Ok((amt, cltv)) => (amt, cltv),
Err(()) => {
- return encode_relay_error("Trampoline blinded forward amt or CLTV values exceeded the outer onion's",
+ return encode_relay_error("Underflow calculating outbound amount or cltv value for blinded trampoline forward",
LocalHTLCFailureReason::InvalidOnionBlinding, outer_shared_secret.secret_bytes(), Some(trampoline_shared_secret.secret_bytes()), &[0; 32]);
}
};
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.