Fix bug with committee index for attester duties
It was returning the validator_index instead of the `committee_index`.
This commit is contained in:
parent
48801e4674
commit
5c44f97fba
@ -47,8 +47,9 @@ impl BeaconState {
|
||||
let mut result = None;
|
||||
for slot in self.get_current_epoch_boundaries(spec.epoch_length) {
|
||||
for (committee, shard) in self.get_crosslink_committees_at_slot(slot, spec)? {
|
||||
if let Some(committee_index) = committee.iter().find(|i| **i == validator_index) {
|
||||
result = Some(Ok((slot, shard, *committee_index as u64)));
|
||||
if let Some(committee_index) = committee.iter().position(|&i| i == validator_index)
|
||||
{
|
||||
result = Some(Ok((slot, shard, committee_index as u64)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user