mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Fix bug with committee index for attester duties
It was returning the validator_index instead of the `committee_index`.
This commit is contained in:
@@ -47,8 +47,9 @@ impl BeaconState {
|
|||||||
let mut result = None;
|
let mut result = None;
|
||||||
for slot in self.get_current_epoch_boundaries(spec.epoch_length) {
|
for slot in self.get_current_epoch_boundaries(spec.epoch_length) {
|
||||||
for (committee, shard) in self.get_crosslink_committees_at_slot(slot, spec)? {
|
for (committee, shard) in self.get_crosslink_committees_at_slot(slot, spec)? {
|
||||||
if let Some(committee_index) = committee.iter().find(|i| **i == validator_index) {
|
if let Some(committee_index) = committee.iter().position(|&i| i == validator_index)
|
||||||
result = Some(Ok((slot, shard, *committee_index as u64)));
|
{
|
||||||
|
result = Some(Ok((slot, shard, committee_index as u64)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user