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

fix: preserve pending CLN and NWC payment status (#4361)

Public commit record

What the developer wrote

Authored by Vlad Stan

70/100 · Adequate
fix: preserve pending CLN and NWC payment status (#4361)
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes a bug where LNbits would incorrectly mark certain Lightning payments as failed when they might still be pending. For Core Lightning (CLN) backends, error code 203 ('permanent failure') can sometimes occur even though parts of a multi-part payment are still in flight, so the code now double-checks the actual payment status before declaring failure. For Nostr Wallet Connect (NWC) backends, outgoing payments were wrongly being treated as failed just because the invoice expired, even though the payment itself may still succeed. The fix prevents users from being incorrectly refunded or shown a failed status for payments that could still complete.

Recommended action

Review payment reconciliation logic in other wallet backends for similar premature failure classification, and ensure that refunds or status updates are only triggered after definitive terminal states are confirmed.

Security signals we found

01

Incorrect payment status classification could lead to double-spend or erroneous refund

02

Error code 203 treated as unconditionally terminal despite upstream xpay behavior leaving parts pending

03

Outgoing NWC payments marked failed on invoice expiry, conflating invoice state with payment outcome

04

Fix adds secondary status verification before marking CLN payment failed

05

Test cases added/updated to enforce ambiguous-error handling

Risk score

Why this scored 62/100

Our methodology →
Potential impact 18/30
Exploitability 10/25
Stealth signal 12/15
Affected reach 10/15
Confidence 8/10
Evidence quality 4/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.