engines/engine_v2: fix staticcheck warning S1009: should omit nil check

This commit is contained in:
Daniel Liu 2024-10-31 16:31:26 +08:00
parent b74fccc04d
commit 363d9784bf

View file

@ -109,7 +109,7 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade
if !bytes.Equal(header.Nonce[:], utils.NonceDropVote) {
return utils.ErrInvalidCheckpointVote
}
if header.Validators == nil || len(header.Validators) == 0 {
if len(header.Validators) == 0 {
return utils.ErrEmptyEpochSwitchValidators
}
if len(header.Validators)%common.AddressLength != 0 {