diff --git a/server/federation.go b/server/federation.go index ad8b09e..e6f31cd 100644 --- a/server/federation.go +++ b/server/federation.go @@ -116,34 +116,6 @@ func (s *Server) loadPeers() error { return nil } - -// getFastestPeer determines the fastest peer in its list of peers by sending -// out udp pings and seeing who responds first. This is currently not -// implemented and just returns the first peer. -func (s *Server) getFastestPeer() *FederatedServer { - var fastestPeer *FederatedServer - - for _, v := range s.PeerServers { - return v - } - - return fastestPeer -} - -// subscribeToFastestPeer is a convenience function to find and subscribe to -// the fastest peer we know about. -func (s *Server) subscribeToFastestPeer() { - peer := s.getFastestPeer() - if peer != nil { - err := s.subscribeToPeer(peer) - if err != nil { - log.Println(err) - } - } else { - log.Println("No peers found, not subscribed to any.") - } -} - // subscribeToPeer subscribes us to a peer to we'll get updates about their // known peers. func (s *Server) subscribeToPeer(peer *FederatedServer) error { diff --git a/server/server.go b/server/server.go index 7727cd6..e82ebe2 100644 --- a/server/server.go +++ b/server/server.go @@ -219,17 +219,10 @@ func MakeHubServer(ctx context.Context, args *Args) *Server { } // Load peers from disk and subscribe to one if there are any if args.LoadPeers { - // We Subscribed to true, so we don't try subscribing to peers as we - // add them, we'll find the best one after - s.Subscribed = true err = s.loadPeers() if err != nil { log.Println(err) } - // subscribe to the fastest peer we know (if there are any) for updates - // about their peers. - s.Subscribed = false - s.subscribeToFastestPeer() } return s