mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-25 18:51:20 +02:00
Merge pull request #3693 from cfromknecht/tlv-invoice
migrate to tlv for invoice body
This commit is contained in:
@@ -2580,10 +2580,6 @@ var addInvoiceCommand = cli.Command{
|
||||
Usage: "a description of the payment to attach along " +
|
||||
"with the invoice (default=\"\")",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "receipt",
|
||||
Usage: "an optional cryptographic receipt of payment",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "preimage",
|
||||
Usage: "the hex-encoded preimage (32 byte) which will " +
|
||||
@@ -2628,7 +2624,6 @@ func addInvoice(ctx *cli.Context) error {
|
||||
var (
|
||||
preimage []byte
|
||||
descHash []byte
|
||||
receipt []byte
|
||||
amt int64
|
||||
err error
|
||||
)
|
||||
@@ -2665,14 +2660,8 @@ func addInvoice(ctx *cli.Context) error {
|
||||
return fmt.Errorf("unable to parse description_hash: %v", err)
|
||||
}
|
||||
|
||||
receipt, err = hex.DecodeString(ctx.String("receipt"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to parse receipt: %v", err)
|
||||
}
|
||||
|
||||
invoice := &lnrpc.Invoice{
|
||||
Memo: ctx.String("memo"),
|
||||
Receipt: receipt,
|
||||
RPreimage: preimage,
|
||||
Value: amt,
|
||||
DescriptionHash: descHash,
|
||||
|
Reference in New Issue
Block a user