Skip to content

Commit

Permalink
fix: identify: push should not dial a new connection
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Nov 12, 2024
1 parent 3ba2089 commit 915400e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions p2p/protocol/identify/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ func (ids *idService) sendPushes(ctx context.Context) {
defer func() { <-sem }()
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()

// We only want to send an identify push if we already have an open
// connection.
ctx = network.WithNoDial(ctx, "id push")
str, err := ids.Host.NewStream(ctx, c.RemotePeer(), IDPush)
if err != nil { // connection might have been closed recently
return
Expand Down

0 comments on commit 915400e

Please sign in to comment.