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

fix: spark l2 `USER_SWAP_RETURNED` means it failed (#4258)

Public commit record

What the developer wrote

Authored by Vlad Stan

70/100 · Adequate
fix: spark l2 `USER_SWAP_RETURNED` means it failed (#4258)
✓ 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 how LNbits handles a specific payment status from the Breez Spark SDK called USER_SWAP_RETURNED. Previously, this status was not treated as a failure, which could cause LNbits to incorrectly believe a Lightning payment succeeded when it actually failed. This could lead to incorrect accounting, such as marking an invoice as paid when the funds were returned to the sender.

Recommended action

Review related Spark L2 payment status handling to ensure all SDK terminal states are mapped correctly. Consider adding tests covering each Breez Spark SDK terminal status. Users relying on Spark L2 wallets should update to include this fix.

Security signals we found

01

Incorrect payment status classification

02

Potential financial/accounting inconsistency

03

Reliance on third-party SDK status semantics

Risk score

Why this scored 42/100

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