From 7f7877a02326ecace5c120ddced413880c272170 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Tue, 7 Dec 2021 17:42:09 +0800 Subject: [PATCH] miner: update pending block even after the PoS transition (#24075) --- miner/worker.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index 041c03af8..2c576ad08 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1039,17 +1039,15 @@ func (w *worker) commit(uncles []*types.Header, interval func(), update bool, st if err != nil { return err } - - // If we're post merge, just ignore - td, ttd := w.chain.GetTd(block.ParentHash(), block.NumberU64()-1), w.chain.Config().TerminalTotalDifficulty - if td != nil && ttd != nil && td.Cmp(ttd) >= 0 { - return nil - } - if w.isRunning() { if interval != nil { interval() } + // If we're post merge, just ignore + td, ttd := w.chain.GetTd(block.ParentHash(), block.NumberU64()-1), w.chain.Config().TerminalTotalDifficulty + if td != nil && ttd != nil && td.Cmp(ttd) >= 0 { + return nil + } select { case w.taskCh <- &task{receipts: receipts, state: s, block: block, createdAt: time.Now()}: w.unconfirmed.Shift(block.NumberU64() - 1)