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

paymentsdb: implement DeleteFailedAttempts for sql backend

Public commit record

What the developer wrote

Authored by ziggie

50/100 · Thin
paymentsdb: implement DeleteFailedAttempts for sql backend
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This commit adds a missing database cleanup feature for the SQL backend of LND's payment database. It lets the node delete failed payment attempts after a payment finishes, matching behavior that already existed for the older key-value database backend. There is no obvious security vulnerability in the change; it is a feature-completion patch with a defensive guard that refuses cleanup while a payment still has active/in-flight HTLCs.

Recommended action

No immediate security action required. Review the TODO about moving keepFailedPaymentAttempts logic to the application layer in a follow-up, and verify that paymentStatus.removable() correctly rejects StatusInFlight and accepts terminal states. Consider adding tests for idempotency and concurrent in-flight status handling.

Security signals we found

01

New deletion path guarded by payment status check (removable())

02

Explicit refusal to delete attempts for in-flight payments (ErrPaymentInFlight)

03

Transaction-wrapped deletion to maintain consistency

04

Configuration flag (keepFailedPaymentAttempts) can skip deletion entirely

05

TODO comments flag mixing of application logic with database logic

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/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.