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

pytest: test for fetchinvoice when a onion-message-capable peer is disconnected.

Public commit record

What the developer wrote

Authored by Rusty Russell

83/100 · Strong
pytest: test for fetchinvoice when a onion-message-capable peer is disconnected.

```
FAILED tests/test_pay.py::test_fetchinvoice_autoconnect_if_disconnected - pyln.client.lightning.RpcError: RPC call failed: method: fetchinvoice, payload: {'offer': 'lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqypq5tn5v4ehghmxv46xx6rfdemx76trv40kzat5da3k7mnwv43hghmfve0kg6tnvdhkumn9vd6x2ep3zcssxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzza'}, error: {'code': -1, 'message': 'onion msg: unknown next peer 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59'}
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, 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 adds a new automated test to Core Lightning. The test checks that when a user tries to fetch a BOLT12 invoice through a peer that is currently disconnected, the software should not attempt to use that disconnected peer. The commit message shows the test previously failed with an 'unknown next peer' error, suggesting a bug where disconnected onion-message-capable peers were incorrectly selected as routing hops. This is a test-only change; no production code is patched here.

Recommended action

Treat this as a test-only commit that documents a bug. The actual fix for the 'unknown next peer' behavior when an onion-message-capable peer is disconnected must be located in a separate commit that updates the routing/peer-selection logic. Reviewers should run the new test and verify it passes only after the corresponding production fix is applied; if it still fails, the bug remains unpatched.

Security signals we found

01

Regression test for routing failure involving disconnected onion-message peers

02

Failure mode exposes peer public key in error message ('unknown next peer')

03

Potential denial-of-service or reliability issue if disconnected peers are selected as invoice-fetch paths

04

No production code change in this commit

Risk score

Why this scored 26/100

Our methodology →
Potential impact 5/30
Exploitability 5/25
Stealth signal 5/15
Affected reach 5/15
Confidence 4/10
Evidence quality 2/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.