lnrpc: add IsAmp to Invoice

This commit is contained in:
Conner Fromknecht committed 2021-05-10 16:55:17 -07:00
1 parent 541041f4a8
commit 2be874f340
6 files changed
+926 -896

No files matched your search

+4 -1
View File
@@ -147,6 +147,8 @@ func CreateRPCInvoice(invoice *channeldb.Invoice,
rpcHtlcs = append(rpcHtlcs, &rpcHtlc)
}
isAmp := invoice.Terms.Features.HasFeature(lnwire.AMPOptional)
rpcInvoice := &lnrpc.Invoice{
Memo: string(invoice.Memo),
RHash: rHash,
@@ -170,8 +172,9 @@ func CreateRPCInvoice(invoice *channeldb.Invoice,
State: state,
Htlcs: rpcHtlcs,
Features: CreateRPCFeatures(invoice.Terms.Features),
IsKeysend: len(invoice.PaymentRequest) == 0,
IsKeysend: len(invoice.PaymentRequest) == 0 && !isAmp,
PaymentAddr: invoice.Terms.PaymentAddr[:],
IsAmp: isAmp,
}
if preimage != nil {