Skip to content

Commit

Permalink
miner: update pending block even after the PoS transition (ethereum#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
rjl493456442 authored Dec 7, 2021
1 parent d785905 commit 7f7877a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7f7877a

Please sign in to comment.