diff --git a/router/routes.go b/router/routes.go index b463b658..50705635 100644 --- a/router/routes.go +++ b/router/routes.go @@ -65,21 +65,13 @@ func (routes *Routes) UnicastAll(name PeerName) (PeerName, bool) { func (routes *Routes) Broadcast(name PeerName) []PeerName { routes.RLock() defer routes.RUnlock() - hops, found := routes.broadcast[name] - if !found { - return []PeerName{} - } - return hops + return routes.broadcast[name] } func (routes *Routes) BroadcastAll(name PeerName) []PeerName { routes.RLock() defer routes.RUnlock() - hops, found := routes.broadcastAll[name] - if !found { - return []PeerName{} - } - return hops + return routes.broadcastAll[name] } // Choose min(log2(n_peers), n_neighbouring_peers) neighbours, with a