Skip to content

Commit

Permalink
fix: return early as expected when engine.Prepare fails (scroll-tech#886
Browse files Browse the repository at this point in the history
)
  • Loading branch information
omerfirmak authored and lwedge99 committed Aug 27, 2024
1 parent 9058762 commit a112ed9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions miner/scroll_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@ func (w *worker) startNewPipeline(timestamp int64) {
header.Coinbase = w.coinbase
}

common.WithTimer(prepareTimer, func() {
if err := w.engine.Prepare(w.chain, header); err != nil {
log.Error("Failed to prepare header for mining", "err", err)
return
}
})
prepareStart := time.Now()
if err := w.engine.Prepare(w.chain, header); err != nil {
log.Error("Failed to prepare header for mining", "err", err)
return
}
prepareTimer.UpdateSince(prepareStart)

// If we are care about TheDAO hard-fork check whether to override the extra-data or not
if daoBlock := w.chainConfig.DAOForkBlock; daoBlock != nil {
Expand Down

0 comments on commit a112ed9

Please sign in to comment.