lnrpc/invoicesrpc: add is_key_send flag to rpc invoice

This commit is contained in:
Joost Jager 2019-12-12 08:10:15 +01:00
parent 1d5844c196
commit c08865f4ae
No known key found for this signature in database
GPG key ID: A61B9D4C393C59C7
4 changed files with 642 additions and 618 deletions

View file

@ -146,6 +146,7 @@ func CreateRPCInvoice(invoice *channeldb.Invoice,
State: state, State: state,
Htlcs: rpcHtlcs, Htlcs: rpcHtlcs,
Features: CreateRPCFeatures(invoice.Terms.Features), Features: CreateRPCFeatures(invoice.Terms.Features),
IsKeySend: len(invoice.PaymentRequest) == 0,
} }
if preimage != channeldb.UnknownPreimage { if preimage != channeldb.UnknownPreimage {

File diff suppressed because it is too large Load diff

View file

@ -2545,6 +2545,12 @@ message Invoice {
/// List of features advertised on the invoice. /// List of features advertised on the invoice.
map<uint32, Feature> features = 24 [json_name = "features"]; map<uint32, Feature> features = 24 [json_name = "features"];
/**
Indicates if this invoice was a spontaneous payment that arrived via keysend
[EXPERIMENTAL].
*/
bool is_key_send = 25 [json_name = "is_key_send"];
} }
enum InvoiceHTLCState { enum InvoiceHTLCState {

View file

@ -2896,6 +2896,11 @@
"$ref": "#/definitions/lnrpcFeature" "$ref": "#/definitions/lnrpcFeature"
}, },
"description": "/ List of features advertised on the invoice." "description": "/ List of features advertised on the invoice."
},
"is_key_send": {
"type": "boolean",
"format": "boolean",
"description": "*\nIndicates if this invoice was a spontaneous payment that arrived via keysend\n[EXPERIMENTAL]."
} }
} }
}, },