From 627d77ae24cc15f063e522f77e593c9c9110fec7 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Tue, 18 Nov 2025 20:19:18 +0800 Subject: [PATCH] eth/hook: fix parameter mame mismatch in `HookPenalties()`, close XFN-141 (#1741) --- eth/hooks/engine_v2_hooks.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/hooks/engine_v2_hooks.go b/eth/hooks/engine_v2_hooks.go index 876f07e961..d1f8ac1659 100644 --- a/eth/hooks/engine_v2_hooks.go +++ b/eth/hooks/engine_v2_hooks.go @@ -38,14 +38,14 @@ type RewardLog struct { func AttachConsensusV2Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConfig *params.ChainConfig) { // Hook scans for bad masternodes and decide to penalty them - adaptor.EngineV2.HookPenalty = func(chain consensus.ChainReader, number *big.Int, currentHash common.Hash, candidates []common.Address) ([]common.Address, error) { + adaptor.EngineV2.HookPenalty = func(chain consensus.ChainReader, number *big.Int, parentHash common.Hash, candidates []common.Address) ([]common.Address, error) { start := time.Now() listBlockHash := []common.Hash{} // get list block hash & stats total created block statMiners := make(map[common.Address]int) - listBlockHash = append(listBlockHash, currentHash) + listBlockHash = append(listBlockHash, parentHash) parentNumber := number.Uint64() - 1 - parentHash := currentHash + currentHash := parentHash var round types.Round // check and wait the latest block is already in the disk