Skip to content

Track in-progress inbound connections to prevent duplicate dials #33197

@the-shadow-coder

Description

@the-shadow-coder

Currently, the p2p server has a TODO comment in server.go:

TODO: track in-progress inbound node IDs (pre-Peer) to avoid dialing them.

This issue addresses a race condition where:

  1. Node A initiates an inbound connection to us (starts handshaking)
  2. Simultaneously, our dial scheduler attempts to dial Node A outbound
  3. Both connections can proceed, resulting in duplicate connections to the same peer

This wastes resources and can cause issues with peer counting and connection management.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions