mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
ethstats: avoid blocking chan when received invalid stats request
This commit is contained in:
parent
46698d7931
commit
83b1734cc2
1 changed files with 8 additions and 3 deletions
|
|
@ -320,8 +320,13 @@ func (s *Service) readLoop(conn *websocket.Conn) {
|
||||||
request, ok := msg["emit"][1].(map[string]interface{})
|
request, ok := msg["emit"][1].(map[string]interface{})
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Warn("Invalid stats history request", "msg", msg["emit"][1])
|
log.Warn("Invalid stats history request", "msg", msg["emit"][1])
|
||||||
s.histCh <- nil
|
select {
|
||||||
continue // Ethstats sometime sends invalid history requests, ignore those
|
// treat it as an no indexes request in which we will return top ones block histories
|
||||||
|
case s.histCh <- nil:
|
||||||
|
continue
|
||||||
|
default:
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
list, ok := request["list"].([]interface{})
|
list, ok := request["list"].([]interface{})
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
@ -349,7 +354,7 @@ func (s *Service) readLoop(conn *websocket.Conn) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// nodeInfo is the collection of metainformation about a node that is displayed
|
// nodeInfo is the collection of meta information about a node that is displayed
|
||||||
// on the monitoring page.
|
// on the monitoring page.
|
||||||
type nodeInfo struct {
|
type nodeInfo struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue