Skip to content

Commit 627d77a

Browse files
authored
eth/hook: fix parameter mame mismatch in HookPenalties(), close XFN-141 (#1741)
1 parent 6235de7 commit 627d77a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

eth/hooks/engine_v2_hooks.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ type RewardLog struct {
3838

3939
func AttachConsensusV2Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConfig *params.ChainConfig) {
4040
// Hook scans for bad masternodes and decide to penalty them
41-
adaptor.EngineV2.HookPenalty = func(chain consensus.ChainReader, number *big.Int, currentHash common.Hash, candidates []common.Address) ([]common.Address, error) {
41+
adaptor.EngineV2.HookPenalty = func(chain consensus.ChainReader, number *big.Int, parentHash common.Hash, candidates []common.Address) ([]common.Address, error) {
4242
start := time.Now()
4343
listBlockHash := []common.Hash{}
4444
// get list block hash & stats total created block
4545
statMiners := make(map[common.Address]int)
46-
listBlockHash = append(listBlockHash, currentHash)
46+
listBlockHash = append(listBlockHash, parentHash)
4747
parentNumber := number.Uint64() - 1
48-
parentHash := currentHash
48+
currentHash := parentHash
4949

5050
var round types.Round
5151
// check and wait the latest block is already in the disk

0 commit comments

Comments
 (0)