mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
engine_v2: fix potential modulo by zero, close XFN-17 (#1615)
This commit is contained in:
parent
785d51ef5a
commit
b882d194ba
1 changed files with 3 additions and 0 deletions
|
|
@ -217,6 +217,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