Skip to content

Commit 7a2805e

Browse files
author
Brian Tiger Chow
committed
fix(swarm) pass the caller's context to the Dialer
1 parent 3f9500a commit 7a2805e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/swarm/swarm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (s *Swarm) Dial(ctx context.Context, peer peer.Peer) (conn.Conn, error) {
140140
return nil, fmt.Errorf("Attempted to connect to loopback address: %s", raddr)
141141
}
142142

143-
c, err = d.Dial(s.Context(), "tcp", peer) // TODO bug: function should block on the context of the caller
143+
c, err = d.Dial(ctx, "tcp", peer) // TODO bug: function should block on the context of the caller
144144
if err != nil {
145145
return nil, err
146146
}

0 commit comments

Comments
 (0)