reject a channel that reuses an existing funding outpoint - #9318
Merged
Conversation
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.
cdecker
approved these changes
Jul 16, 2026
Member
|
Excellent work @daywalker90, thank you 🤗 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Confirmed working. We do a disconnect in this case.
Changelog-None