QSP-61 Clarify Why Process Pending Attestations May Exit Early (#6371)

* clarify with comment
* Merge refs/heads/master into qsp-61
* Merge refs/heads/master into qsp-61
* Merge refs/heads/master into qsp-61
This commit is contained in:
Raul Jordan 2020-06-23 17:34:31 -05:00 committed by GitHub
parent 7ba26aa433
commit 2bdb825c04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,10 @@ 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 there are no peer id's available, then we should exit from this function. The function will
// be run again periodically, and there may be peers available in future runs.
if len(pids) == 0 {
log.Debug("No peer IDs available to request missing block from for pending attestation")
return nil
}
pid := pids[rand.Int()%len(pids)]