mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-30 07:05:06 +03:00
Return correct JSON-encoded results
This commit is contained in:
parent
bf520c3c25
commit
2d3d741659
1 changed files with 2 additions and 6 deletions
|
@ -107,7 +107,7 @@ func (s *Crawler) SetupAdminHandlers(a *admin.AdminSocket) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Crawler) getNetworkMap() string {
|
func (s *Crawler) getNetworkMap() results {
|
||||||
starttime := time.Now()
|
starttime := time.Now()
|
||||||
s.dhtVisited = make(map[string]attempt)
|
s.dhtVisited = make(map[string]attempt)
|
||||||
s.nodeInfoVisited = make(map[string]interface{})
|
s.nodeInfoVisited = make(map[string]interface{})
|
||||||
|
@ -150,11 +150,7 @@ func (s *Crawler) getNetworkMap() string {
|
||||||
res.Meta.NodesSuccessful = found
|
res.Meta.NodesSuccessful = found
|
||||||
res.Meta.NodesFailed = attempted - found
|
res.Meta.NodesFailed = attempted - found
|
||||||
|
|
||||||
if j, err := json.MarshalIndent(res, "", "\t"); err == nil {
|
return res
|
||||||
return string(j)
|
|
||||||
} else {
|
|
||||||
return "json marshaling error"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Crawler) dhtPing(pubkey crypto.BoxPubKey, coords []uint64) {
|
func (s *Crawler) dhtPing(pubkey crypto.BoxPubKey, coords []uint64) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue