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

fix(nwc): prevent false payment failures on NWC provider sync delay (#4066)

Public commit record

What the developer wrote

Authored by Nathan Day

85/100 · Strong
fix(nwc): prevent false payment failures on NWC provider sync delay (#4066)

Co-authored-by: dadofsambonzuki <dadofsambonzuki@noemail.com>
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a bug in LNbits' NWC (Nostr Wallet Connect) wallet integration where payments could be incorrectly marked as failed due to delays in the NWC provider updating its records. The fix makes the wallet wait longer and use cached proof of payment before declaring a payment failed. It also adds better handling for missing fee information and lost payment responses. The bug could have caused users' successful payments to be reported as failed, potentially leading to duplicate payments or accounting errors, but it does not appear to allow an external attacker to steal funds directly.

Recommended action

Review and merge if not already deployed. Monitor for any continued reports of false payment failures with NWC providers. Consider whether the pending-state timeout behavior needs explicit upper bounds to avoid payments remaining in limbo indefinitely.

Security signals we found

01

Incorrect payment failure state could lead to duplicate payment attempts or inconsistent accounting

02

Race condition / synchronization delay between wallet action and provider state indexing

03

Missing fee data could cause premature finalization of payment status

04

Lost pay_invoice responses previously could leave payments without checking_id, now preserved

05

NOT_FOUND errors from provider were previously treated as final failure, now treated as pending

Risk score

Why this scored 57/100

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