Skip to content

Commit

Permalink
Merge pull request #1244 from libp2p/allow-ping-on-transient-connections
Browse files Browse the repository at this point in the history
allow the ping protocol on transient connections
  • Loading branch information
marten-seemann authored Nov 23, 2021
2 parents cac4cf3 + adecbc7 commit 838220f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/protocol/ping/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (ps *PingService) Ping(ctx context.Context, p peer.ID) <-chan Result {
// Ping pings the remote peer until the context is canceled, returning a stream
// of RTTs or errors.
func Ping(ctx context.Context, h host.Host, p peer.ID) <-chan Result {
s, err := h.NewStream(ctx, p, ID)
s, err := h.NewStream(network.WithUseTransient(ctx, "ping"), p, ID)
if err != nil {
ch := make(chan Result, 1)
ch <- Result{Error: err}
Expand Down

0 comments on commit 838220f

Please sign in to comment.