Skip to content

reject a channel that reuses an existing funding outpoint - #9318

Merged
cdecker merged 2 commits into
ElementsProject:masterfrom
daywalker90:reject-channel
Jul 16, 2026
Merged

reject a channel that reuses an existing funding outpoint#9318
cdecker merged 2 commits into
ElementsProject:masterfrom
daywalker90:reject-channel

Conversation

@daywalker90

@daywalker90 daywalker90 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Confirmed working. We do a disconnect in this case.

Changelog-None

nGoline added 2 commits July 16, 2026 13:26
A v1 channel_id is derived solely from the funding outpoint, so two
channels funded by the same outpoint would share a channel_id.  When a
peer completes a second funding using an outpoint we already have a
channel for, refuse it and drop the connection instead of committing a
second channel with a colliding channel_id.

Add find_channel_by_funding_outpoint() to look up an existing channel by
its funding outpoint.
peer_connect_subd asserted that the subd had no connection yet.  Replace
that assertion with defensive handling: if a connection is already
attached for this channel_id, keep it and close the incoming fd.  This
avoids aborting connectd in the unexpected case where a second fd
arrives for a subd that already has one.
@daywalker90 daywalker90 added this to the v26.09 milestone Jul 16, 2026
@cdecker
cdecker merged commit c7a013c into ElementsProject:master Jul 16, 2026
99 of 104 checks passed
@cdecker

cdecker commented Jul 16, 2026

Copy link
Copy Markdown
Member

Excellent work @daywalker90, thank you 🤗

@Masi452 Masi452 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yooooooooniceiii

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants