good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 81e9caed authored by Hao Duan's avatar Hao Duan Committed by GitHub
Browse files

ethstats: avoid blocking chan when received invalid stats request (#21073)


* ethstats: avoid blocking chan when received invalid stats request

* ethstats: minor code polishes

Co-authored-by: default avatarPéter Szilágyi <peterke@gmail.com>
parent 7ddb4023
No related branches found
No related tags found
No related merge requests found
...@@ -320,8 +320,11 @@ func (s *Service) readLoop(conn *websocket.Conn) { ...@@ -320,8 +320,11 @@ 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 case s.histCh <- nil: // Treat it as an no indexes request
default:
}
continue
} }
list, ok := request["list"].([]interface{}) list, ok := request["list"].([]interface{})
if !ok { if !ok {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment