From 994eded4c066bade794597834445c2daa01bf63a Mon Sep 17 00:00:00 2001 From: Shane Bammel Date: Fri, 8 Oct 2021 12:44:22 -0500 Subject: [PATCH] Squelch err in case of non-authorized miner --- miner/worker.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/miner/worker.go b/miner/worker.go index dcce308ab..a9f00ed99 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -925,7 +925,10 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64) header.Coinbase = w.coinbase } if err := w.engine.Prepare(w.chain, header); err != nil { - log.Error("Failed to prepare header for mining", "err", err) + // Ignore ErrUnauthorizedValidator, miner.etherbase is not unlocked + if _, ok := err.(*consensus.ErrUnauthorizedValidator); !ok { + log.Error("Failed to prepare header for mining", "err", err) + } return } // If we are care about TheDAO hard-fork check whether to override the extra-data or not