Skip to content

Commit

Permalink
cmd: CLI for blinded path hodl invoices.
Browse files Browse the repository at this point in the history
  • Loading branch information
ellemouton committed Aug 25, 2024
1 parent cd56381 commit 5fdc91d
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions cmd/commands/invoicesrpc_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ var addHoldInvoiceCommand = cli.Command{
"private channels in order to assist the " +
"payer in reaching you",
},
blindFlag,
minRealBlindedHops,
numBlindedHops,
maxBlindedPaths,
blindedPathNodeOmissions,
},
Action: actionDecorator(addHoldInvoice),
}
Expand Down Expand Up @@ -241,16 +246,24 @@ func addHoldInvoice(ctx *cli.Context) error {
return fmt.Errorf("unable to parse description_hash: %w", err)
}

blindedPathCfg, err := parseBlindedPathCfg(ctx)
if err != nil {
return fmt.Errorf("could not parse blinded path config: %w",
err)
}

invoice := &invoicesrpc.AddHoldInvoiceRequest{
Memo: ctx.String("memo"),
Hash: hash,
Value: amt,
ValueMsat: amtMsat,
DescriptionHash: descHash,
FallbackAddr: ctx.String("fallback_addr"),
Expiry: ctx.Int64("expiry"),
CltvExpiry: ctx.Uint64("cltv_expiry_delta"),
Private: ctx.Bool("private"),
Memo: ctx.String("memo"),
Hash: hash,
Value: amt,
ValueMsat: amtMsat,
DescriptionHash: descHash,
FallbackAddr: ctx.String("fallback_addr"),
Expiry: ctx.Int64("expiry"),
CltvExpiry: ctx.Uint64("cltv_expiry_delta"),
Private: ctx.Bool("private"),
IsBlinded: ctx.Bool(blindFlag.Name),
BlindedPathConfig: blindedPathCfg,
}

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

0 comments on commit 5fdc91d

Please sign in to comment.