diff --git a/rpcserver.go b/rpcserver.go index 4b085af0..9fcaa75d 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -2888,6 +2888,7 @@ func (r *rpcServer) ListInvoices(ctx context.Context, IndexOffset: req.IndexOffset, NumMaxInvoices: req.NumMaxInvoices, PendingOnly: req.PendingOnly, + Reversed: req.Reversed, } invoiceSlice, err := r.server.chanDB.QueryInvoices(q) if err != nil { @@ -2897,11 +2898,12 @@ func (r *rpcServer) ListInvoices(ctx context.Context, // Before returning the response, we'll need to convert each invoice // into it's proto representation. resp := &lnrpc.ListInvoiceResponse{ - Invoices: make([]*lnrpc.Invoice, len(invoiceSlice.Invoices)), - LastIndexOffset: invoiceSlice.LastIndexOffset, + Invoices: make([]*lnrpc.Invoice, len(invoiceSlice.Invoices)), + FirstIndexOffset: invoiceSlice.FirstIndexOffset, + LastIndexOffset: invoiceSlice.LastIndexOffset, } for i, invoice := range invoiceSlice.Invoices { - resp.Invoices[i], err = createRPCInvoice(invoice) + resp.Invoices[i], err = createRPCInvoice(&invoice) if err != nil { return nil, err }