Skip to content

Commit c34a7c5

Browse files
miner: prevent nil deref
1 parent 932939f commit c34a7c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

miner/worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ func (w *worker) commit(uncles []*types.Header, interval func(), update bool, st
10411041
}
10421042

10431043
// If we're post merge, just ignore
1044-
if td := w.chain.GetTd(block.ParentHash(), block.NumberU64()-1); td.Cmp(w.chain.Config().TerminalTotalDifficulty) >= 0 {
1044+
if td, ttd := w.chain.GetTd(block.ParentHash(), block.NumberU64()-1), w.chain.Config().TerminalTotalDifficulty; td != nil && ttd != nil && td.Cmp(ttd) >= 0 {
10451045
return nil
10461046
}
10471047

0 commit comments

Comments
 (0)