cosmetic
This commit is contained in:
1 parent
145ebf3950
commit
4a3fc47246
1 file changed
+11
-11
+11
-11
@@ -111,18 +111,18 @@ 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] {
|
||||||
address := conn.RemoteTCPAddr()
|
return
|
||||||
//log.Println("Unconnected peer:", peer2, address)
|
}
|
||||||
// try both portnumber of connection and standart port
|
address := conn.RemoteTCPAddr()
|
||||||
if host, port, err := ExtractHostPort(address); err == nil {
|
// try both portnumber of connection and standart port
|
||||||
if port != Port {
|
if host, port, err := ExtractHostPort(address); err == nil {
|
||||||
// This is an address with port, that is not the standard port
|
if port != Port {
|
||||||
validTarget[address] = true
|
// This is an address with port, that is not the standard port
|
||||||
}
|
validTarget[address] = true
|
||||||
// Add the address with standard port
|
|
||||||
validTarget[NormalisePeerAddr(host)] = true
|
|
||||||
}
|
}
|
||||||
|
// Add the address with standard port
|
||||||
|
validTarget[NormalisePeerAddr(host)] = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user