From 86a4746b6a3ca509d5238b39bbedcf407fb5072e Mon Sep 17 00:00:00 2001 From: Aranha <50056110+aranhaagency@users.noreply.github.com> Date: Sun, 16 Feb 2020 19:13:03 -0300 Subject: [PATCH] fixed panic: runtime error: integer divide by zero #4777 (#4823) --- beacon-chain/sync/pending_attestations_queue.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/beacon-chain/sync/pending_attestations_queue.go b/beacon-chain/sync/pending_attestations_queue.go index 2a24800d7f9..cf31b82df15 100644 --- a/beacon-chain/sync/pending_attestations_queue.go +++ b/beacon-chain/sync/pending_attestations_queue.go @@ -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 {