Add an 'outbound' field on each connection,
and only attempt new connections to the remote side of outbound connections.
This commit is contained in:
1 parent
6f89ead9bd
commit
89fce7f98a
8 files changed
+26
-14
No files matched your search
@@ -140,7 +140,7 @@ 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] {
|
||||
if otherPeer == cm.ourself.Name || ourConnectedPeers[otherPeer] || !conn.Outbound() {
|
||||
return
|
||||
}
|
||||
address := conn.RemoteTCPAddr()
|
||||
|
||||
Reference in new issue
Block a user