diff --git a/router/connection.go b/router/connection.go index ff79fbf5..0bf360ef 100644 --- a/router/connection.go +++ b/router/connection.go @@ -493,7 +493,7 @@ func (conn *LocalConnection) receiveTCP(decoder *gob.Decoder, usingPassword bool // the payload are not included // - elements where the payload was older than the // receiver's version are updated - conn.SendTCP(Concat(ProtocolUpdateByte, conn.Router.Topology.FetchAll())) + conn.SendTCP(Concat(ProtocolUpdateByte, conn.Router.Peers.EncodeAllPeers())) } else if msg[0] == ProtocolUpdate { newUpdate, err := conn.Router.Peers.ApplyUpdate(msg[1:], conn.Router) if _, ok := err.(UnknownPeersError); err != nil && ok { diff --git a/router/topology.go b/router/topology.go index b8578f6b..02c3dcbf 100644 --- a/router/topology.go +++ b/router/topology.go @@ -54,19 +54,9 @@ func StartTopology(router *Router) *Topology { // ACTOR client API const ( - TFetchAll = iota TRebuildRoutes = iota ) -func (topo *Topology) FetchAll() []byte { - resultChan := make(chan interface{}, 0) - topo.queryChan <- &Interaction{ - code: TFetchAll, - resultChan: resultChan} - result := <-resultChan - return result.([]byte) -} - // Async. func (topo *Topology) RebuildRoutes() { topo.queryChan <- &Interaction{code: TRebuildRoutes} @@ -88,8 +78,6 @@ func (topo *Topology) queryLoop(queryChan <-chan *Interaction) { topo.unicast = unicast topo.broadcast = broadcast topo.Unlock() - case TFetchAll: - query.resultChan <- topo.router.Peers.EncodeAllPeers() default: log.Fatal("Unexpected topology query:", query) }