Fix off-by-one error in CommitteeCache

This commit is contained in:
Paul Hauner 2019-05-20 16:46:44 +10:00
parent 21de9c1cb8
commit 048f342e1d
No known key found for this signature in database
GPG Key ID: 5E2CFF9B75FA63DF

View File

@ -76,7 +76,7 @@ impl CommitteeCache {
.ok_or_else(|| Error::UnableToShuffle)?;
// The use of `NonZeroUsize` reduces the maximum number of possible validators by one.
if state.validator_registry.len() >= usize::max_value() - 1 {
if state.validator_registry.len() > usize::max_value() - 1 {
return Err(Error::TooManyValidators);
}