diff --git a/connection.go b/connection.go index 4545f0a1..f0aed6f9 100644 --- a/connection.go +++ b/connection.go @@ -277,10 +277,6 @@ func (conn *LocalConnection) handleShutdown() { // blank out the forwardChan so that the router processes don't // try to send any more conn.stopForwarders() - - if conn.remote != nil { - conn.Router.ConnectionMaker.EnsureConnection(conn.remoteTCPAddr) - } } func (conn *LocalConnection) handshake(acceptNewPeer bool) error { diff --git a/connection_maker.go b/connection_maker.go index b15c7a5d..01107664 100644 --- a/connection_maker.go +++ b/connection_maker.go @@ -37,14 +37,9 @@ func StartConnectionMaker(router *Router) *ConnectionMaker { func (cm *ConnectionMaker) InitiateConnection(address string) { cm.queryChan <- &ConnectionMakerInteraction{ Interaction: Interaction{code: CMInitiate}, - isCmdLine: true, address: address} } -func (cm *ConnectionMaker) EnsureConnection(address string) { - // Do nothing - we will figure out what to do later -} - func (cm *ConnectionMaker) String() string { resultChan := make(chan interface{}, 0) cm.queryChan <- &ConnectionMakerInteraction{ @@ -74,7 +69,7 @@ func (cm *ConnectionMaker) queryLoop(queryChan <-chan *ConnectionMakerInteractio } switch { case query.code == CMInitiate: - cm.addToTargets(query.isCmdLine, query.address) + cm.addToTargets(true, query.address) tickNow() case query.code == CMStatus: query.resultChan <- cm.status() diff --git a/peer.go b/peer.go index b09771ee..4d3dd0c6 100644 --- a/peer.go +++ b/peer.go @@ -121,11 +121,6 @@ func (peer *Peer) SetVersionAndConnections(version uint64, connections map[PeerN defer peer.Unlock() peer.version = version peer.connections = connections - for remoteName, conn := range connections { - if remoteName != peer.Router.Ourself.Name { - peer.Router.ConnectionMaker.EnsureConnection(conn.RemoteTCPAddr()) - } - } } func (peer *Peer) Forward(dstPeer *Peer, df bool, frame []byte, dec *EthernetDecoder) error { diff --git a/types.go b/types.go index e5effe91..c3b93394 100644 --- a/types.go +++ b/types.go @@ -155,7 +155,6 @@ type Topology struct { type ConnectionMakerInteraction struct { Interaction - isCmdLine bool address string }