rpc: set PaymentRequest+CreationDate in LookupInvoice respones
This commit is contained in:
parent
39e145f037
commit
d8d7dab258
@ -1202,12 +1202,19 @@ func (r *rpcServer) LookupInvoice(ctx context.Context,
|
||||
return spew.Sdump(invoice)
|
||||
}))
|
||||
|
||||
preimage := invoice.Terms.PaymentPreimage
|
||||
return &lnrpc.Invoice{
|
||||
Memo: string(invoice.Memo[:]),
|
||||
Receipt: invoice.Receipt[:],
|
||||
RPreimage: invoice.Terms.PaymentPreimage[:],
|
||||
RPreimage: preimage[:],
|
||||
Value: int64(invoice.Terms.Value),
|
||||
CreationDate: invoice.CreationDate.Unix(),
|
||||
Settled: invoice.Terms.Settled,
|
||||
PaymentRequest: zpay32.Encode(&zpay32.PaymentRequest{
|
||||
Destination: r.server.identityPriv.PubKey(),
|
||||
PaymentHash: fastsha256.Sum256(preimage[:]),
|
||||
Amount: invoice.Terms.Value,
|
||||
}),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user