From 2d3d741659989284497f3661ec3c2d5d487b4cd2 Mon Sep 17 00:00:00 2001 From: George Date: Fri, 27 Mar 2020 15:29:02 -0400 Subject: [PATCH] Return correct JSON-encoded results --- src/dhtcrawler/crawler.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/dhtcrawler/crawler.go b/src/dhtcrawler/crawler.go index 4f6c15c5..4f3eb202 100644 --- a/src/dhtcrawler/crawler.go +++ b/src/dhtcrawler/crawler.go @@ -107,7 +107,7 @@ func (s *Crawler) SetupAdminHandlers(a *admin.AdminSocket) { }) } -func (s *Crawler) getNetworkMap() string { +func (s *Crawler) getNetworkMap() results { starttime := time.Now() s.dhtVisited = make(map[string]attempt) s.nodeInfoVisited = make(map[string]interface{}) @@ -150,11 +150,7 @@ func (s *Crawler) getNetworkMap() string { res.Meta.NodesSuccessful = found res.Meta.NodesFailed = attempted - found - if j, err := json.MarshalIndent(res, "", "\t"); err == nil { - return string(j) - } else { - return "json marshaling error" - } + return res } func (s *Crawler) dhtPing(pubkey crypto.BoxPubKey, coords []uint64) {