Merge pull request #722 from gzliudan/fix-s1009

engines/engine_v2: fix staticcheck warning S1009: omit redundant nil check on slice
This commit is contained in:
Daniel Liu 2024-10-31 21:54:56 +08:00 committed by GitHub
commit 00fe74afd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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 {