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

connectd: simplify logic, and add a "reconnected" message.

Public commit record

What the developer wrote

Authored by Rusty Russell

73/100 · Adequate
connectd: simplify logic, and add a "reconnected" message.

One issue we have in CI is reconnection races: if an incoming
connection arrives while an outgoing one is negotiated, we close the
outgoing one and issue a disconnect, which fails any connect attempts.

By sending a "reconnected" message instead of disconnect/connect we
can avoid disturbing in-progress connection attempts which happens in CI
quite a bit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit rewrites how Core Lightning handles peer reconnections. Previously, when a new incoming connection arrived while an outgoing one was still being negotiated, the daemon would tear down the old connection and report a full disconnect followed by a new connect. That sequence often caused in-progress connection attempts to fail, especially in automated CI tests. The patch introduces a single 'reconnected' message that replaces the disconnect/connect pair, so the higher-level code sees a smooth handover instead of a failure. It also refactors the cleanup paths for peer objects and subdaemons. The change is described by the author as a reliability improvement for CI races, not as a security fix, and no independent security advisory is supplied.

Recommended action

Treat as a normal reliability/refactoring patch. Reviewers should verify that the new reconnection path correctly updates the peer's connectd_counter, that subd file descriptors are closed promptly, and that suppressing connect_failed_disconnect during reconnections cannot leave stale connect commands pending indefinitely. No urgent security action is indicated by the supplied materials.

Security signals we found

01

Refactoring of peer disconnection and reconnection state machine

02

New inter-daemon wire message for reconnection events

03

Change to whether in-progress connect attempts are marked as failed during reconnection races

04

Removal of drain_peer public API in favor of disconnect_peer/destroy_peer_immediately

05

No explicit security claim or CVE reference in commit or supplied materials

Risk score

Why this scored 34/100

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