lnrpc: remove receipt field from invoice

This commit is contained in:
Conner Fromknecht committed 2019-11-22 02:23:24 -08:00
1 parent 6f9fcfaccc
commit 76a2dfd8a6
7 files changed
+554 -596

No files matched your search

-9
View File
@@ -57,10 +57,6 @@ type AddInvoiceData struct {
// description_hash field is not being used.
Memo string
// Deprecated. An optional cryptographic receipt of payment which is not
// implemented.
Receipt []byte
// The preimage which will allow settling an incoming HTLC payable to
// this preimage. If Preimage is set, Hash should be nil. If both
// Preimage and Hash are nil, a random preimage is generated.
@@ -154,10 +150,6 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
return nil, nil, fmt.Errorf("memo too large: %v bytes "+
"(maxsize=%v)", len(invoice.Memo), channeldb.MaxMemoSize)
}
if len(invoice.Receipt) > channeldb.MaxReceiptSize {
return nil, nil, fmt.Errorf("receipt too large: %v bytes "+
"(maxsize=%v)", len(invoice.Receipt), channeldb.MaxReceiptSize)
}
if len(invoice.DescriptionHash) > 0 && len(invoice.DescriptionHash) != 32 {
return nil, nil, fmt.Errorf("description hash is %v bytes, must be 32",
len(invoice.DescriptionHash))
@@ -392,7 +384,6 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
newInvoice := &channeldb.Invoice{
CreationDate: creationDate,
Memo: []byte(invoice.Memo),
Receipt: invoice.Receipt,
PaymentRequest: []byte(payReqString),
FinalCltvDelta: int32(payReq.MinFinalCLTVExpiry()),
Expiry: payReq.Expiry(),
-1
View File
@@ -94,7 +94,6 @@ func CreateRPCInvoice(invoice *channeldb.Invoice,
rpcInvoice := &lnrpc.Invoice{
Memo: string(invoice.Memo[:]),
Receipt: invoice.Receipt[:],
RHash: decoded.PaymentHash[:],
Value: int64(satAmt),
ValueMsat: int64(invoice.Terms.Value),
+553 -565
View File
File diff suppressed because it is too large. Load diff
+1 -4
View File
@@ -2217,10 +2217,7 @@ message Invoice {
*/
string memo = 1 [json_name = "memo"];
/** Deprecated. An optional cryptographic receipt of payment which is not
implemented.
*/
bytes receipt = 2 [json_name = "receipt", deprecated = true];
reserved 2;
/**
The hex-encoded preimage (32 byte) which will allow settling an incoming
-5
View File
@@ -2660,11 +2660,6 @@
"type": "string",
"description": "*\nAn optional memo to attach along with the invoice. Used for record keeping\npurposes for the invoice's creator, and will also be set in the description\nfield of the encoded payment request if the description_hash field is not\nbeing used."
},
"receipt": {
"type": "string",
"format": "byte",
"description": "* Deprecated. An optional cryptographic receipt of payment which is not\nimplemented."
},
"r_preimage": {
"type": "string",
"format": "byte",