ConsensusInfo retrieves node consensus information
(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
| 485 | |
| 486 | // ConsensusInfo retrieves node consensus information |
| 487 | func (s *Server) ConsensusInfo(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { |
| 488 | if err := r.ParseForm(); err != nil { |
| 489 | write(w, err, http.StatusBadRequest) |
| 490 | return |
| 491 | } |
| 492 | summary, err := s.controller.ConsensusSummary() |
| 493 | if err != nil { |
| 494 | write(w, err, http.StatusInternalServerError) |
| 495 | return |
| 496 | } |
| 497 | w.Header().Set(ContentType, ApplicationJSON) |
| 498 | w.WriteHeader(http.StatusOK) |
| 499 | if _, e := w.Write(summary); e != nil { |
| 500 | s.logger.Error(e.Error()) |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | // PeerInfo retrieves node peer information |
| 505 | func (s *Server) PeerInfo(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) { |
nothing calls this directly
no test coverage detected