This commit is contained in:
Matthias Radestock committed 2014-09-10 16:47:41 +01:00
1 parent 145ebf3950
commit 4a3fc47246
1 file changed
+3 -3
+3 -3
View File
@@ -111,9 +111,10 @@ func (cm *ConnectionMaker) checkStateAndAttemptConnections(now time.Time) {
// Add peers that someone else is connected to, but we aren't // Add peers that someone else is connected to, but we aren't
cm.router.Peers.ForEach(func(name PeerName, peer *Peer) { cm.router.Peers.ForEach(func(name PeerName, peer *Peer) {
peer.ForEachConnection(func(peer2 PeerName, conn Connection) { peer.ForEachConnection(func(peer2 PeerName, conn Connection) {
if peer2 != ourself.Name && !our_connected_peers[peer2] { if peer2 == ourself.Name || our_connected_peers[peer2] {
return
}
address := conn.RemoteTCPAddr() address := conn.RemoteTCPAddr()
//log.Println("Unconnected peer:", peer2, address)
// try both portnumber of connection and standart port // try both portnumber of connection and standart port
if host, port, err := ExtractHostPort(address); err == nil { if host, port, err := ExtractHostPort(address); err == nil {
if port != Port { if port != Port {
@@ -123,7 +124,6 @@ func (cm *ConnectionMaker) checkStateAndAttemptConnections(now time.Time) {
// Add the address with standard port // Add the address with standard port
validTarget[NormalisePeerAddr(host)] = true validTarget[NormalisePeerAddr(host)] = true
} }
}
}) })
}) })