AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 23 Bitcoin

lightningd: fix error code on waitsendpay on old errors.

Public commit record

What the developer wrote

Authored by Rusty Russell

73/100 · Adequate
lightningd: fix error code on waitsendpay on old errors.

We don't explicitly save the return code in db, so we need to reconstruct it.

We didn't cover the "peer told us our onion was bad" corner case. But it's hardly
worth a changelog message, since users will never see this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a corner case where Core Lightning returned the wrong error code when a payment failed because a peer directly reported that our encrypted routing packet (the 'onion') was malformed. Previously the code only distinguished between permanent destination failures and 'try another route,' but it missed the case where the immediate peer couldn't parse the onion at all. The fix adds the correct error code for that situation and removes a test marker that expected the bug to fail.

Recommended action

No immediate action required beyond normal patching. Operators should update to a version containing this commit if they rely on accurate waitsendpay error codes for payment-failure diagnostics or automated retry logic.

Security signals we found

01

Incorrect error-code reconstruction for historical payment failures

02

Missing handling of BADONION failure bit in RPC error mapping

03

Test previously expected failure (xfail) now passing after fix

Risk score

Why this scored 23/100

Our methodology →
Potential impact 4/30
Exploitability 2/25
Stealth signal 3/15
Affected reach 4/15
Confidence 7/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.