diff --git a/services/horizon/internal/ingest/processors/liquidity_pools_transaction_processor.go b/services/horizon/internal/ingest/processors/liquidity_pools_transaction_processor.go index a4e5886e73..c721f9e4ba 100644 --- a/services/horizon/internal/ingest/processors/liquidity_pools_transaction_processor.go +++ b/services/horizon/internal/ingest/processors/liquidity_pools_transaction_processor.go @@ -73,6 +73,9 @@ func liquidityPoolsForTransaction(transaction ingest.LedgerTransaction) ([]strin } func dedupeStrings(in []string) []string { + if len(in) <= 1 { + return in + } sort.Strings(in) insert := 1 for cur := 1; cur < len(in); cur++ { diff --git a/services/horizon/internal/ingest/processors/operations_processor.go b/services/horizon/internal/ingest/processors/operations_processor.go index b74f682a71..8ad023145c 100644 --- a/services/horizon/internal/ingest/processors/operations_processor.go +++ b/services/horizon/internal/ingest/processors/operations_processor.go @@ -1036,6 +1036,9 @@ func (operation *transactionOperationWrapper) Participants() ([]xdr.AccountId, e // dedupeParticipants remove any duplicate ids from `in` func dedupeParticipants(in []xdr.AccountId) []xdr.AccountId { + if len(in) <= 1 { + return in + } sort.Slice(in, func(i, j int) bool { return in[i].Address() < in[j].Address() })