mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-16 18:00:46 +00:00
fix: add a error log when author not found for the block that will be emitted to ethstats (#427)
Co-authored-by: wjrjerome <wjrjerome@babylonchain.io>
This commit is contained in:
parent
54b254e25c
commit
b739db6a52
1 changed files with 12 additions and 8 deletions
|
|
@ -94,13 +94,14 @@ type Service struct {
|
||||||
// websocket.
|
// websocket.
|
||||||
//
|
//
|
||||||
// From Gorilla websocket docs:
|
// From Gorilla websocket docs:
|
||||||
// Connections support one concurrent reader and one concurrent writer.
|
//
|
||||||
// Applications are responsible for ensuring that no more than one goroutine calls the write methods
|
// Connections support one concurrent reader and one concurrent writer.
|
||||||
// - NextWriter, SetWriteDeadline, WriteMessage, WriteJSON, EnableWriteCompression, SetCompressionLevel
|
// Applications are responsible for ensuring that no more than one goroutine calls the write methods
|
||||||
// concurrently and that no more than one goroutine calls the read methods
|
// - NextWriter, SetWriteDeadline, WriteMessage, WriteJSON, EnableWriteCompression, SetCompressionLevel
|
||||||
// - NextReader, SetReadDeadline, ReadMessage, ReadJSON, SetPongHandler, SetPingHandler
|
// concurrently and that no more than one goroutine calls the read methods
|
||||||
// concurrently.
|
// - NextReader, SetReadDeadline, ReadMessage, ReadJSON, SetPongHandler, SetPingHandler
|
||||||
// The Close and WriteControl methods can be called concurrently with all other methods.
|
// concurrently.
|
||||||
|
// The Close and WriteControl methods can be called concurrently with all other methods.
|
||||||
type connWrapper struct {
|
type connWrapper struct {
|
||||||
conn *websocket.Conn
|
conn *websocket.Conn
|
||||||
|
|
||||||
|
|
@ -674,7 +675,10 @@ func (s *Service) assembleBlockStats(block *types.Block) *blockStats {
|
||||||
txs = []txStats{}
|
txs = []txStats{}
|
||||||
}
|
}
|
||||||
// Assemble and return the block stats
|
// Assemble and return the block stats
|
||||||
author, _ := s.engine.Author(header)
|
author, err := s.engine.Author(header)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("Failed to retrieve block author", "err", err, "number", header.Number, "hash", header.Hash())
|
||||||
|
}
|
||||||
|
|
||||||
return &blockStats{
|
return &blockStats{
|
||||||
Number: header.Number,
|
Number: header.Number,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue