From 84c8ed636242142f2f2be51f942afb6aae928abc Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 19 Jan 2018 17:32:32 -0800 Subject: [PATCH] cmd/lncli: expose the final_cltv_delta flag in sendpayment --- cmd/lncli/commands.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 5e553b3d7..21588d862 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -975,6 +975,10 @@ var sendPaymentCommand = cli.Command{ Name: "pay_req", Usage: "a zpay32 encoded payment request to fulfill", }, + cli.Int64Flag{ + Name: "final_cltv_delta", + Usage: "the number of blocks the last hop has to reveal the preimage", + }, }, Action: sendPayment, } @@ -1055,6 +1059,17 @@ func sendPayment(ctx *cli.Context) error { "bytes, is instead %v", len(rHash)) } req.PaymentHash = rHash + + switch { + case ctx.IsSet("final_cltv_delta"): + req.FinalCltvDelta = int32(ctx.Int64("final_cltv_delta")) + case args.Present(): + delta, err := strconv.ParseInt(args.First(), 10, 64) + if err != nil { + return err + } + req.FinalCltvDelta = int32(delta) + } } }