Skip to content

Commit

Permalink
fix(lib/babe): check if authority index is in the authorities range (
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed Jun 21, 2022
1 parent 7886318 commit 1072888
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 @@ -390,7 +390,7 @@ func (b *verifier) verifyPreRuntimeDigest(digest *types.PreRuntimeDigest) (scale
authIdx = d.AuthorityIndex
}

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

0 comments on commit 1072888

Please sign in to comment.