Skip to content

Commit

Permalink
Merge pull request #1518 from 0chain/fix/panic-on-network
Browse files Browse the repository at this point in the history
fix panic on network request
  • Loading branch information
dabasov authored Dec 19, 2024
2 parents 2bcf023 + e5ae60c commit cdcf01d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions code/go/0chain.net/blobbercore/handler/handler_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,19 @@ func HomepageHandler(w http.ResponseWriter, r *http.Request) {
node.Self.ID, node.Self.PublicKey, build.BuildTag,
)

fmt.Fprintf(w, "<div>Miners ...\n")
network, _ := client.GetNetwork(context.Background())
for _, miner := range network.Miners {
fmt.Fprintf(w, "%v\n", miner)
}
fmt.Fprintf(w, "</div>\n")
fmt.Fprintf(w, "<div>Sharders ...\n")
for _, sharder := range network.Sharders {
fmt.Fprintf(w, "%v\n", sharder)
network, err := client.GetNetwork(context.Background())
if err == nil {
fmt.Fprintf(w, "<div>Miners ...\n")
for _, miner := range network.Miners {
fmt.Fprintf(w, "%v\n", miner)
}
fmt.Fprintf(w, "</div>\n")
fmt.Fprintf(w, "<div>Sharders ...\n")
for _, sharder := range network.Sharders {
fmt.Fprintf(w, "%v\n", sharder)
}
fmt.Fprintf(w, "</div>\n")
}
fmt.Fprintf(w, "</div>\n")
fmt.Fprintf(w, "</br>")
fmt.Fprintf(w, "<div>Running since %v (Total elapsed time: %v)</div>\n", StartTime.Format(common.DateTimeFormat), time.Since(StartTime))
fmt.Fprintf(w, "</br>")
Expand Down

0 comments on commit cdcf01d

Please sign in to comment.