From ebd46555ac95505a6b3c0bb39af5f3dcfb43a2aa Mon Sep 17 00:00:00 2001 From: Jon Lundy Date: Sat, 18 Mar 2023 12:55:23 -0600 Subject: [PATCH] feat(peers): add peerlist --- app/peerfinder/http.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/peerfinder/http.go b/app/peerfinder/http.go index 4527207..b7d6218 100644 --- a/app/peerfinder/http.go +++ b/app/peerfinder/http.go @@ -90,6 +90,9 @@ func (s *service) ServeHTTP(w http.ResponseWriter, r *http.Request) { case strings.HasPrefix(r.URL.Path, "/peers/status"): s.state.Modify(r.Context(), func(ctx context.Context, state *state) error { + for id, p := range state.peers { + fmt.Fprintln(w, "PEER: ", id[24:], " ", p.Owner) + } for id, rq := range state.requests { fmt.Fprintln(w, "REQ: ", id, rq.RequestIP, len(rq.Responses))