Unverified Commit 7f7877a0 authored by rjl493456442's avatar rjl493456442 Committed by GitHub

miner: update pending block even after the PoS transition (#24075)

parent d7859056
...@@ -1039,17 +1039,15 @@ func (w *worker) commit(uncles []*types.Header, interval func(), update bool, st ...@@ -1039,17 +1039,15 @@ func (w *worker) commit(uncles []*types.Header, interval func(), update bool, st
if err != nil { if err != nil {
return err 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 w.isRunning() {
if interval != nil { if interval != nil {
interval() 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 { select {
case w.taskCh <- &task{receipts: receipts, state: s, block: block, createdAt: time.Now()}: case w.taskCh <- &task{receipts: receipts, state: s, block: block, createdAt: time.Now()}:
w.unconfirmed.Shift(block.NumberU64() - 1) w.unconfirmed.Shift(block.NumberU64() - 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment