mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
Merge pull request #4241 from Roasbeef/listpayment-copy
channeldb: eliminate extra copy in QueryPayments
This commit is contained in:
commit
0dfb946afd
@ -460,7 +460,7 @@ type PaymentsQuery struct {
|
||||
type PaymentsResponse struct {
|
||||
// Payments is the set of payments returned from the database for the
|
||||
// PaymentsQuery.
|
||||
Payments []MPPayment
|
||||
Payments []*MPPayment
|
||||
|
||||
// FirstIndexOffset is the index of the first element in the set of
|
||||
// returned MPPayments. Callers can use this to resume their query
|
||||
@ -536,7 +536,7 @@ func (db *DB) QueryPayments(query PaymentsQuery) (PaymentsResponse, error) {
|
||||
continue
|
||||
}
|
||||
|
||||
resp.Payments = append(resp.Payments, *payment)
|
||||
resp.Payments = append(resp.Payments, payment)
|
||||
}
|
||||
|
||||
// Need to swap the payments slice order if reversed order.
|
||||
|
@ -5191,7 +5191,7 @@ func (r *rpcServer) ListPayments(ctx context.Context,
|
||||
for _, payment := range paymentsQuerySlice.Payments {
|
||||
payment := payment
|
||||
|
||||
rpcPayment, err := r.routerBackend.MarshallPayment(&payment)
|
||||
rpcPayment, err := r.routerBackend.MarshallPayment(payment)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user