lncli: add cltv limit

This commit is contained in:
Joost Jager 2019-02-13 12:26:29 +01:00
parent acb8fd4796
commit ec0d241905
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -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",
@ -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",
@ -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)
@ -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 " +
@ -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)
}