rpcserver: include new proto fields in ListInvoices rpc
This commit is contained in:
parent
8e151ffd3f
commit
012d4f5c8c
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user