network: implement unconnected/bad peers getters

Which allows node to respond to `getpeers` RPC request correctly.
This commit is contained in:
Roman Khimov 2020-01-10 15:16:14 +03:00
parent d92e193e63
commit 723b33e108

View file

@ -190,12 +190,12 @@ func (s *Server) Shutdown() {
// UnconnectedPeers returns a list of peers that are in the discovery peer list
// but are not connected to the server.
func (s *Server) UnconnectedPeers() []string {
return []string{}
return s.discovery.UnconnectedPeers()
}
// BadPeers returns a list of peers the are flagged as "bad" peers.
func (s *Server) BadPeers() []string {
return []string{}
return s.discovery.BadPeers()
}
// ConnectedPeers returns a list of currently connected peers.