Add an 'outbound' field on each connection,

and only attempt new connections to the remote side of outbound connections.
This commit is contained in:
Bryan Boreham committed 2015-03-11 11:56:47 +00:00
1 parent 6f89ead9bd
commit 89fce7f98a
8 files changed
+26 -14

No files matched your search

+1 -1
View File
@@ -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()