miner: only commit work when mining

This commit is contained in:
hadv 2019-07-09 12:03:10 +07:00
parent 5873c01c3d
commit 67f1d42a90
No known key found for this signature in database
GPG key ID: EC2B318ACE3D164F

View file

@ -861,11 +861,11 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
return
}
header.Coinbase = w.coinbase
}
if err := w.engine.Prepare(w.chain, header); err != nil {
log.Error("Failed to prepare header for mining", "err", err)
return
}
}
// If we are care about TheDAO hard-fork check whether to override the extra-data or not
if daoBlock := w.chainConfig.DAOForkBlock; daoBlock != nil {
// Check whether the block is among the fork extra-override range