Skip to content

Commit

Permalink
lncli: add cltv limit
Browse files Browse the repository at this point in the history
  • Loading branch information
joostjager committed Mar 19, 2019
1 parent acb8fd4 commit ec0d241
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/lncli/commands.go
Expand Up @@ -1954,6 +1954,12 @@ func closedChannels(ctx *cli.Context) error {
return nil
}

var cltvLimitFlag = cli.UintFlag{
Name: "cltv_limit",
Usage: "the maximum time lock that may be used for " +
"this payment",
}

var sendPaymentCommand = cli.Command{
Name: "sendpayment",
Category: "Payments",
Expand Down Expand Up @@ -2000,6 +2006,7 @@ var sendPaymentCommand = cli.Command{
Usage: "percentage of the payment's amount used as the" +
"maximum fee allowed when sending the payment",
},
cltvLimitFlag,
cli.StringFlag{
Name: "payment_hash, r",
Usage: "the hash to use within the payment's HTLC",
Expand Down Expand Up @@ -2119,6 +2126,7 @@ func sendPayment(ctx *cli.Context) error {
Amt: ctx.Int64("amt"),
FeeLimit: feeLimit,
OutgoingChanId: ctx.Uint64("outgoing_chan_id"),
CltvLimit: uint32(ctx.Int(cltvLimitFlag.Name)),
}

return sendPaymentRequest(client, req)
Expand Down Expand Up @@ -2266,6 +2274,7 @@ var payInvoiceCommand = cli.Command{
Usage: "percentage of the payment's amount used as the" +
"maximum fee allowed when sending the payment",
},
cltvLimitFlag,
cli.Uint64Flag{
Name: "outgoing_chan_id",
Usage: "short channel id of the outgoing channel to " +
Expand Down Expand Up @@ -2312,7 +2321,9 @@ func payInvoice(ctx *cli.Context) error {
Amt: ctx.Int64("amt"),
FeeLimit: feeLimit,
OutgoingChanId: ctx.Uint64("outgoing_chan_id"),
CltvLimit: uint32(ctx.Int(cltvLimitFlag.Name)),
}

return sendPaymentRequest(client, req)
}

Expand Down

0 comments on commit ec0d241

Please sign in to comment.