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

Avoid repeated persisted async invoice refreshes

Public commit record

What the developer wrote

Authored by Elias Rohrer

78/100 · Adequate
Avoid repeated persisted async invoice refreshes

When a used async receive offer's refreshed static invoice is persisted,
advance the recorded invoice creation time. This keeps the refresh
threshold anchored to the newest invoice instead of making the offer
look stale on every timer tick.

Add coverage that a used offer does not enqueue another
ServeStaticInvoice immediately after the server confirms the refresh.

Co-Authored-By: HAL 9000

This finding was discovered by Project Loupe
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug where a Lightning node's timer would keep refreshing and re-sending the same static invoice over and over, instead of waiting for the proper refresh interval. The root cause was using the older (minimum) invoice creation time rather than the newest (maximum) one when deciding if an offer looked stale. This could waste bandwidth, create unnecessary network messages, and potentially cause the node to look unreliable or spammy to peers.

Recommended action

Apply the patch. The change is small, well-tested, and corrects a clear logic error. Monitor for any related timer-driven loops that compare timestamps with min() where max() is semantically required.

Security signals we found

01

Repeated message generation due to stale timestamp comparison

02

Resource exhaustion / amplification risk from persistent timer-driven refreshes

03

Logic bug in state-machine timestamp update (min vs max)

04

Potential peer reputation degradation from repeated invoice serving

05

No explicit cryptographic or memory-safety flaw

Risk score

Why this scored 37/100

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