Skip to content

Conversation

@the-shadow-coder
Copy link
Contributor

Closes #33197

This PR adds a pendingInbound map in server.go to track in-progress inbound connections (after encryption handshake, before becoming a full peer). The server notifies the dial scheduler via new inboundPending() and inboundCompleted() methods, allowing checkDial() to skip nodes that are already connecting to us. This prevents the race condition where we attempt to dial a node while it's simultaneously dialing us, saving network resources and avoiding duplicate connections. Added tests in both dial_test.go and server_test.go to verify the behavior

@the-shadow-coder the-shadow-coder changed the title Track in-progress inbound node IDs (pre-Peer) to avoid dialing them. p2p: Track in-progress inbound node IDs (pre-Peer) to avoid dialing them. Nov 16, 2025
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.

Track in-progress inbound connections to prevent duplicate dials

1 participant