lnrpc: include payment addr in main Invoice proto

With this change ListInvoices will return the payment addr, and the
response to AddInvoice will as well.
This commit is contained in:
Olaoluwa Osuntokun 2020-11-24 19:05:14 -08:00
parent d996607470
commit 43fc84919e
No known key found for this signature in database
GPG key ID: 3BBD59E99B280306
6 changed files with 829 additions and 773 deletions

View file

@ -427,6 +427,11 @@
"type": "boolean",
"format": "boolean",
"description": "Indicates if this invoice was a spontaneous payment that arrived via keysend\n[EXPERIMENTAL]."
},
"payment_addr": {
"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."
}
}
},

View file

@ -148,6 +148,7 @@ func CreateRPCInvoice(invoice *channeldb.Invoice,
Htlcs: rpcHtlcs,
Features: CreateRPCFeatures(invoice.Terms.Features),
IsKeysend: len(invoice.PaymentRequest) == 0,
PaymentAddr: invoice.Terms.PaymentAddr[:],
}
if preimage != nil {

File diff suppressed because it is too large Load diff

View file

@ -2897,6 +2897,13 @@ message Invoice {
[EXPERIMENTAL].
*/
bool is_keysend = 25;
/*
The payment address of this invoice. This value will be used in MPP
payments, and also for newer invoies that always require the MPP paylaod
for added end-to-end security.
*/
bytes payment_addr = 26;
}
enum InvoiceHTLCState {
@ -2955,6 +2962,13 @@ message AddInvoiceResponse {
invoices with an add_index greater than this one.
*/
uint64 add_index = 16;
/*
The payment address of the generated invoice. This value should be used
in all payments for this invoice as we require it for end to end
security.
*/
bytes payment_addr = 17;
}
message PaymentHash {
/*

View file

@ -2461,6 +2461,11 @@
"type": "string",
"format": "uint64",
"description": "The \"add\" index of this invoice. Each newly created invoice will increment\nthis index making it monotonically increasing. Callers to the\nSubscribeInvoices call can use this to instantly get notified of all added\ninvoices with an add_index greater than this one."
},
"payment_addr": {
"type": "string",
"format": "byte",
"description": "The payment address of the generated invoice. This value should be used\nin all payments for this invoice as we require it for end to end\nsecurity."
}
}
},
@ -4083,6 +4088,11 @@
"type": "boolean",
"format": "boolean",
"description": "Indicates if this invoice was a spontaneous payment that arrived via keysend\n[EXPERIMENTAL]."
},
"payment_addr": {
"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."
}
}
},

View file

@ -4766,6 +4766,7 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
AddIndex: dbInvoice.AddIndex,
PaymentRequest: string(dbInvoice.PaymentRequest),
RHash: hash[:],
PaymentAddr: dbInvoice.Terms.PaymentAddr[:],
}, nil
}