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

offers: fix fetchinvoice from using disconnected peers.

Public commit record

What the developer wrote

Authored by Rusty Russell

81/100 · Strong
offers: fix fetchinvoice from using disconnected peers.

We didn't remove them from the graph if they were disconnected, leading to us trying to send an onion message to it:

```
➜ ~ lightning-cli fetchinvoice lno1pg7y7s69g98zq5rp09hh2arnypnx7u3qvf3nzut68pmkcet2xdm8s7ngw5ux2am4wqekwmtkddkkk7nyv45ryefexum82anr8phpp6qrse80qf0aara4slvcjxrvu6j2rp5ftmjy4yntlsmsutpkvkt6878sy4xtpdc0j42xp72an4cl0unvzm7ckx2e6ltlzlgeekh0hhe0mgs2qgpetp66ufc9pwln9gmyv0gk3ndpqvvtynef8adzm3lxv0astkxunjcqx0fsq8kmx5cz574ft45vcweaf3tffp90fjdfl9gkdh4s6xfxaz7srtmsju9gnr3xerjhjqw4xtsmp55f4jjsxxrch703kx020l6wn2ttcd24w5h8f2lz723lk2kpa8ftkernz7h2qqkd3zecz2jmhucwh555xf0np4w45zm8tlka4ktw6d3ne4l9u678y37d24xjcy3el53faulcu5tzzquxrxvcyrvzgk7tyjeapt8wu858m2msgdznhqxl8fps04lef9dc9c 1sat
{
"code": -1,
"message": "onion msg: unknown next peer 024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605"
}
```

Fixes: https://github.com/ElementsProject/lightning/issues/8225
Changelog-Fixed: JSON-RPC: `fetchinvoice` is now more reliable.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a reliability bug in Core Lightning's `fetchinvoice` command. When a peer was disconnected, the node still kept that peer in its internal network map, so it sometimes tried to send an invoice request through a peer that was no longer reachable. The fix removes disconnected peers' channels from the map and also avoids using disabled channels for onion messages. This is a bug fix rather than a security vulnerability: the worst outcome was a failed invoice fetch, not loss of funds or remote code execution.

Recommended action

No urgent security action required. Users should upgrade to the release containing this commit if they rely on `fetchinvoice` / BOLT12 offers, as it improves reliability when peers disconnect. Operators may monitor for any remaining fetchinvoice failures with disconnected peers.

Security signals we found

01

Fixes a functional/reliability bug in onion-message path selection

02

Disconnected peers were incorrectly retained in the local routing graph

03

Disabled channels were not excluded from onion-message path selection

04

Test re-enabled after removing xfail marker

Risk score

Why this scored 31/100

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