Fix underflow in verify_indexed_attestation
This commit is contained in:
parent
67f890ae48
commit
55ef75a44e
@ -62,11 +62,13 @@ fn verify_indexed_attestation_parametric<T: EthSpec>(
|
||||
|
||||
// Check that both vectors of indices are sorted
|
||||
let check_sorted = |list: &Vec<u64>| {
|
||||
for i in 0..list.len() - 1 {
|
||||
if list[i] >= list[i + 1] {
|
||||
list.windows(2).enumerate().try_for_each(|(i, pair)| {
|
||||
if pair[0] >= pair[1] {
|
||||
invalid!(Invalid::BadValidatorIndicesOrdering(i));
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
})?;
|
||||
Ok(())
|
||||
};
|
||||
check_sorted(custody_bit_0_indices)?;
|
||||
|
Loading…
Reference in New Issue
Block a user