From ec0d241905759064e82064f19b26527206d0db9e Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Wed, 13 Feb 2019 12:26:29 +0100 Subject: [PATCH] lncli: add cltv limit --- cmd/lncli/commands.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 2b390048..9a5a9a0a 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -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) }