Skip to content

Commit 59e0f5d

Browse files
committed
Return an empty array instead of a null pointer on getTransactions
1 parent da5778f commit 59e0f5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/stellar-rpc/internal/methods/get_transactions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (h transactionsRPCHandler) getTransactionsByLedgerSequence(ctx context.Cont
216216

217217
// Iterate through each ledger and its transactions until limit or end range is reached.
218218
// The latest ledger acts as the end ledger range for the request.
219-
var txns []protocol.TransactionInfo
219+
txns := make([]protocol.TransactionInfo, 0, limit)
220220
var done bool
221221
cursor := toid.New(0, 0, 0)
222222
for ledgerSeq := start.LedgerSequence; ledgerSeq <= int32(ledgerRange.LastLedger.Sequence); ledgerSeq++ {

0 commit comments

Comments
 (0)