Skip to content

Commit

Permalink
identify: fix stale comment (#2179)
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Mar 10, 2023
1 parent bfc6fc3 commit ed96a64
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions p2p/protocol/identify/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ type idService struct {

connsMu sync.RWMutex
// The conns map contains all connections we're currently handling.
// Connections are inserted as soon as they're available in the swarm, and - crucially -
// before any stream can be opened or accepted on that connection.
// Connections are inserted as soon as they're available in the swarm
// Connections are removed from the map when the connection disconnects.
// It is therefore safe to assume that a connection was (recently) closed if there's no entry in this map.
conns map[network.Conn]entry

addrMu sync.Mutex
Expand Down Expand Up @@ -894,8 +892,6 @@ func (nn *netNotifiee) IDService() *idService {
}

func (nn *netNotifiee) Connected(_ network.Network, c network.Conn) {
// We rely on this notification being received before we receive any incoming streams on the connection.
// The swarm implementation guarantees this.
ids := nn.IDService()

ids.connsMu.Lock()
Expand Down

0 comments on commit ed96a64

Please sign in to comment.