From fb28b78d74d8f367ffa7d7a466851049bfd8d47b Mon Sep 17 00:00:00 2001 From: Urvi Date: Tue, 19 Sep 2023 10:59:31 -0700 Subject: [PATCH] Fix limit bug in subquery --- services/horizon/internal/db2/history/claimable_balances.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/services/horizon/internal/db2/history/claimable_balances.go b/services/horizon/internal/db2/history/claimable_balances.go index 34ecb98bc4..48722a11c3 100644 --- a/services/horizon/internal/db2/history/claimable_balances.go +++ b/services/horizon/internal/db2/history/claimable_balances.go @@ -269,9 +269,7 @@ func (q *Q) GetClaimableBalances(ctx context.Context, query ClaimableBalancesQue // the claimant's address. var selectClaimableBalanceClaimants = sq.Select("id").From("claimable_balance_claimants"). - Where("destination = ?", query.Claimant.Address()) - - selectClaimableBalanceClaimants.Limit(query.PageQuery.Limit) + Where("destination = ?", query.Claimant.Address()).Limit(query.PageQuery.Limit) subSql, err := applyClaimableBalancesQueriesCursor(selectClaimableBalanceClaimants, l, r, query.PageQuery.Order) if err != nil {