Skip to content

Commit

Permalink
fixup! Skip request when there are no validators
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfornax committed Oct 29, 2024
1 parent 9b896cb commit e264be5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions shared/services/beacon/client/std-http-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,9 @@ 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) {
// Map to store results
validatorMap := make(map[string]bool)

// Return if there are not validators to check
if len(indices) == 0 {
return validatorMap, nil
return nil, nil
}

// Perform the post request
Expand All @@ -336,6 +333,9 @@ func (c *StandardHttpClient) GetValidatorSyncDuties(indices []string, epoch uint
return nil, fmt.Errorf("Could not decode validator sync duties data: %w", err)
}

// Map the results
validatorMap := make(map[string]bool)

for _, index := range indices {
validatorMap[index] = false
for _, duty := range response.Data {
Expand Down

0 comments on commit e264be5

Please sign in to comment.