Fix off-by-one error in CommitteeCache
This commit is contained in:
parent
21de9c1cb8
commit
048f342e1d
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user