Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

identify: fix stale comment #2179

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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