Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions eth/hooks/engine_v2_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down