From 55b74d78907c204ff8807630c1c600399698848e Mon Sep 17 00:00:00 2001 From: Fornax <23104993+fornax2@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:53:27 -0300 Subject: [PATCH] Skip request when there are no validators --- shared/services/beacon/client/std-http-client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared/services/beacon/client/std-http-client.go b/shared/services/beacon/client/std-http-client.go index a4517ea16..a8729ec21 100644 --- a/shared/services/beacon/client/std-http-client.go +++ b/shared/services/beacon/client/std-http-client.go @@ -313,6 +313,10 @@ func (c *StandardHttpClient) GetValidatorStatuses(pubkeys []types.ValidatorPubke // Get whether validators have sync duties to perform at given epoch func (c *StandardHttpClient) GetValidatorSyncDuties(indices []string, epoch uint64) (map[string]bool, error) { + // Return if there are not validators to check + if len(indices) == 0 { + return nil, nil + } // Perform the post request responseBody, status, err := c.postRequest(fmt.Sprintf(RequestValidatorSyncDuties, strconv.FormatUint(epoch, 10)), indices)