Skip to content

Commit

Permalink
temp: add to lncli
Browse files Browse the repository at this point in the history
  • Loading branch information
ellemouton committed Jul 2, 2024
1 parent 073417d commit 08a136e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/lncli/cmd_invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ var addInvoiceCommand = cli.Command{
Usage: "creates an AMP invoice. If true, preimage " +
"should not be set.",
},
cli.BoolFlag{
Name: "blind",
Usage: "creates an invoice that contains blinded paths",
},
},
Action: actionDecorator(addInvoice),
}
Expand Down Expand Up @@ -127,6 +131,11 @@ func addInvoice(ctx *cli.Context) error {
return fmt.Errorf("unable to parse description_hash: %w", err)
}

if ctx.IsSet("private") && ctx.IsSet("blind") {
return fmt.Errorf("cannot set both route hints and blinded " +
"paths in the same invoice")
}

invoice := &lnrpc.Invoice{
Memo: ctx.String("memo"),
RPreimage: preimage,
Expand All @@ -138,6 +147,7 @@ func addInvoice(ctx *cli.Context) error {
CltvExpiry: ctx.Uint64("cltv_expiry_delta"),
Private: ctx.Bool("private"),
IsAmp: ctx.Bool("amp"),
Blind: ctx.Bool("blind"),
}

resp, err := client.AddInvoice(ctxc, invoice)
Expand Down

0 comments on commit 08a136e

Please sign in to comment.