diff --git a/backend/pkg/api/data_access/vdb_withdrawals.go b/backend/pkg/api/data_access/vdb_withdrawals.go index c52c205c3..97b3355d0 100644 --- a/backend/pkg/api/data_access/vdb_withdrawals.go +++ b/backend/pkg/api/data_access/vdb_withdrawals.go @@ -136,8 +136,11 @@ func (d *DataAccessService) GetValidatorDashboardWithdrawals(ctx context.Context // Limit the query to relevant validators queryParams = append(queryParams, pq.Array(validators)) whereQuery := fmt.Sprintf(` - WHERE - validatorindex = ANY ($%d)`, len(queryParams)) + WHERE EXISTS ( + SELECT 1 + FROM blocks_withdrawals + WHERE validatorindex = ANY ($%d) + ) AND validatorindex = ANY ($%d)`, len(queryParams), len(queryParams)) // Limit the query using sorting and the cursor orderQuery := ""