Return correct JSON-encoded results

This commit is contained in:
George 2020-03-27 15:29:02 -04:00
parent bf520c3c25
commit 2d3d741659

View file

@ -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) {