Skip to content

Commit 2fbc3c0

Browse files
authored
add startHook to generateWork (#192)
1 parent 6f1d6b6 commit 2fbc3c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

miner/worker.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ func (miner *Miner) generateWork(genParams *generateParams, interrupt *int32) (*
132132
work.gasPool = new(core.GasPool).AddGas(work.header.GasLimit)
133133
}
134134

135+
if err := miner.engine.StartHook(miner.chain, work.header, work.state); err != nil {
136+
return nil, err
137+
}
135138
fillTxErr := miner.fillTransactions(work, genParams.transactions, interrupt)
136139
if fillTxErr != nil && errors.Is(fillTxErr, errBlockInterruptedByTimeout) {
137140
log.Warn("Block building is interrupted", "allowance", common.PrettyDuration(miner.newBlockTimeout))

0 commit comments

Comments
 (0)