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

fix: exponential backoff for IN_FLIGHT payment polling (#3918)

Public commit record

What the developer wrote

Authored by Ben Weeks

70/100 · Adequate
fix: exponential backoff for IN_FLIGHT payment polling (#3918)
✓ 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 patch fixes how LNbits polls the LND lightning node about payments that are still 'in flight' (not yet succeeded or failed). Previously, the code asked for an endless streaming connection with no timeout and immediately returned 'pending' as soon as it saw one IN_FLIGHT update, which could leave long-lived connections hanging and might not correctly reflect the final payment outcome. The change caps each poll at 30 seconds and keeps looping through updates instead of stopping at the first IN_FLIGHT message, giving proper exponential-backoff behavior.

Recommended action

Review and merge if the change passes existing LND REST wallet tests; verify that a 30-second timeout does not break legitimate long-polling behavior on slow networks; consider adding a test that simulates an IN_FLIGHT stream followed by SUCCEEDED/FAILED to ensure the loop terminates correctly.

Security signals we found

01

Denial-of-service resource exhaustion: unbounded streaming connections can accumulate and exhaust HTTP client connections, file descriptors, or memory.

02

State-handling correctness: returning pending on the first IN_FLIGHT event could mask final terminal states and affect payment accounting reliability.

03

Timeout hardening: adding a finite timeout bounds worst-case resource consumption per poll.

04

No input validation changes or cryptographic fixes present.

Risk score

Why this scored 35/100

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