mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-28 10:41:57 +01:00
lnrpc: add IsAmp to Invoice
This commit is contained in:
parent
541041f4a8
commit
2be874f340
@ -463,6 +463,11 @@
|
||||
"type": "string",
|
||||
"format": "byte",
|
||||
"description": "The payment address of this invoice. This value will be used in MPP\npayments, and also for newer invoies that always require the MPP paylaod\nfor added end-to-end security."
|
||||
},
|
||||
"is_amp": {
|
||||
"type": "boolean",
|
||||
"format": "boolean",
|
||||
"description": "Signals whether or not this is an AMP invoice."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -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 {
|
||||
|
1801
lnrpc/rpc.pb.go
1801
lnrpc/rpc.pb.go
File diff suppressed because it is too large
Load Diff
@ -3003,6 +3003,11 @@ message Invoice {
|
||||
for added end-to-end security.
|
||||
*/
|
||||
bytes payment_addr = 26;
|
||||
|
||||
/*
|
||||
Signals whether or not this is an AMP invoice.
|
||||
*/
|
||||
bool is_amp = 27;
|
||||
}
|
||||
|
||||
enum InvoiceHTLCState {
|
||||
|
@ -4387,6 +4387,11 @@
|
||||
"type": "string",
|
||||
"format": "byte",
|
||||
"description": "The payment address of this invoice. This value will be used in MPP\npayments, and also for newer invoies that always require the MPP paylaod\nfor added end-to-end security."
|
||||
},
|
||||
"is_amp": {
|
||||
"type": "boolean",
|
||||
"format": "boolean",
|
||||
"description": "Signals whether or not this is an AMP invoice."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -4824,6 +4824,7 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
|
||||
CltvExpiry: invoice.CltvExpiry,
|
||||
Private: invoice.Private,
|
||||
RouteHints: routeHints,
|
||||
Amp: invoice.IsAmp,
|
||||
}
|
||||
|
||||
if invoice.RPreimage != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user