Skip to content

Commit

Permalink
Update lib/babe/verify.go
Browse files Browse the repository at this point in the history
Co-authored-by: Quentin McGaw <[email protected]>
  • Loading branch information
EclesioMeloJunior and qdm12 authored Jun 14, 2022
1 parent 9d20bae commit 199efc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/babe/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func (b *verifier) verifyPreRuntimeDigest(digest *types.PreRuntimeDigest) (scale
authIdx = d.AuthorityIndex
}

if int(authIdx) < 0 || int(authIdx) >= len(b.authorities) {
if uint64(len(b.authorities)) < uint64(authIndex) {
logger.Tracef("verifyPreRuntimeDigest invalid auth index %d, we have %d auths",
authIdx, len(b.authorities))
return nil, ErrInvalidBlockProducerIndex
Expand Down

0 comments on commit 199efc8

Please sign in to comment.