Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed panic: runtime error: integer divide by zero #4777 #4823

Merged
merged 12 commits into from Feb 16, 2020
3 changes: 3 additions & 0 deletions beacon-chain/sync/pending_attestations_queue.go
Expand Up @@ -117,6 +117,9 @@ func (s *Service) processPendingAtts(ctx context.Context) error {

// Start with a random peer to query, but choose the first peer in our unsorted list that claims to
// have a head slot newer or equal to the pending attestation's target boundary slot.
if len(pids) == 0 {
return nil
}
pid := pids[rand.Int()%len(pids)]
targetSlot := helpers.SlotToEpoch(attestations[0].Aggregate.Data.Target.Epoch)
for _, p := range pids {
Expand Down