Merge pull request #3693 from cfromknecht/tlv-invoice

migrate to tlv for invoice body
This commit is contained in:
Olaoluwa Osuntokun
2019-11-25 18:00:52 -06:00
committed by GitHub
22 changed files with 1569 additions and 822 deletions

View File

@@ -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,