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.
@@ -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.
+ if dir == network.DirOutbound {
s.dsync.CancelDial(p)
+ }
s.notifyAll(func(f network.Notifiee) {
f.Connected(s, c)
