mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
engine_v2: fix potential modulo by zero, close XFN-17 (#1615)
This commit is contained in:
parent
95f0bd2a4b
commit
8c101cd961
1 changed files with 3 additions and 0 deletions
|
|
@ -175,6 +175,9 @@ func (x *XDPoS_v2) CalculateMissingRounds(chain consensus.ChainReader, header *t
|
|||
return nil, err
|
||||
}
|
||||
masternodes := switchInfo.Masternodes
|
||||
if len(masternodes) == 0 {
|
||||
return nil, fmt.Errorf("masternodes is empty in CalculateMissingRounds, number = %v, hash %#x", header.Number, header.Hash())
|
||||
}
|
||||
|
||||
// Loop through from the epoch switch block to the current "header" block
|
||||
nextHeader := header
|
||||
|
|
|
|||
Loading…
Reference in a new issue