From 42448bc99f1a8e381e90ca04e74d727e5edf2d77 Mon Sep 17 00:00:00 2001 From: curryxbo Date: Tue, 6 May 2025 16:47:01 +0800 Subject: [PATCH] add startHook to generateWork --- miner/worker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index 189786821..85c17a50c 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -132,6 +132,9 @@ func (miner *Miner) generateWork(genParams *generateParams, interrupt *int32) (* work.gasPool = new(core.GasPool).AddGas(work.header.GasLimit) } + if err := miner.engine.StartHook(miner.chain, work.header, work.state); err != nil { + return nil, err + } fillTxErr := miner.fillTransactions(work, genParams.transactions, interrupt) if fillTxErr != nil && errors.Is(fillTxErr, errBlockInterruptedByTimeout) { log.Warn("Block building is interrupted", "allowance", common.PrettyDuration(miner.newBlockTimeout))