Skip to content

Commit

Permalink
fixed panic: runtime error: integer divide by zero prysmaticlabs#4777 (
Browse files Browse the repository at this point in the history
  • Loading branch information
aranhaagency authored and cryptomental committed Feb 28, 2020
1 parent ab0c13f commit 5874f6d
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit 5874f6d

Please sign in to comment.