Commit 6e99a760 authored by Adin Schmahmann's avatar Adin Schmahmann

only cancel dials when an outbound connection succeeds. this may result in...

only cancel dials when an outbound connection succeeds. this may result in duplicate connections, but it's better to have two connections than dropping both of them and ending up with zero connections.
parent 514eae9e
......@@ -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