Unverified Commit edeb6039 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #174 from libp2p/fix/simul-dial

Don't drop connections when simultaneous dialing occurs
parents 15881815 6e99a760
......@@ -230,7 +230,9 @@ func (s *Swarm) addConn(tc transport.CapableConn, dir network.Direction) (*Conn,
// We have a connection now. Cancel all other in-progress dials.
// This should be fast, no reason to wait till later.
s.dsync.CancelDial(p)
if dir == network.DirOutbound {
s.dsync.CancelDial(p)
}
s.notifyAll(func(f network.Notifiee) {
f.Connected(s, c)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment