From 8e274328b6663ee15f54210204097b257a0d2c74 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 11 Mar 2015 14:01:43 +0000 Subject: [PATCH] Do try standard port on inbound connections --- router/connection_maker.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/router/connection_maker.go b/router/connection_maker.go index 6f7781fb..6042db51 100644 --- a/router/connection_maker.go +++ b/router/connection_maker.go @@ -140,12 +140,14 @@ func (cm *ConnectionMaker) checkStateAndAttemptConnections() time.Duration { // aren't cm.peers.ForEach(func(name PeerName, peer *Peer) { peer.ForEachConnection(func(otherPeer PeerName, conn Connection) { - if otherPeer == cm.ourself.Name || ourConnectedPeers[otherPeer] || !conn.Outbound() { + if otherPeer == cm.ourself.Name || ourConnectedPeers[otherPeer] { return } address := conn.RemoteTCPAddr() - // try both portnumber of connection and standard port - addTarget(address) + // try both portnumber of connection and standard port. Don't use remote side of inbound connection. + if conn.Outbound() { + addTarget(address) + } if host, _, err := net.SplitHostPort(address); err == nil { addTarget(NormalisePeerAddr(host)) }