From 5aefe8bc709eaecb906abc67c14513053a813fe8 Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Mon, 19 Aug 2019 17:56:13 -0700 Subject: [PATCH] lncli: allow users to update max HTLC channel policies In this commit, we enable callers of UpdateChannelPolicy to specify their desired max HTLC forwarding policy for one or multiple channels over lncli. --- cmd/lncli/commands.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index bb8b362a..79d0e428 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -3337,7 +3337,8 @@ var updateChannelPolicyCommand = cli.Command{ Category: "Channels", Usage: "Update the channel policy for all channels, or a single " + "channel.", - ArgsUsage: "base_fee_msat fee_rate time_lock_delta [channel_point]", + ArgsUsage: "base_fee_msat fee_rate time_lock_delta " + + "[--max_htlc_msat=N] [channel_point]", Description: ` Updates the channel policy for all channels, or just a particular channel identified by its channel point. The update will be committed, and @@ -3362,6 +3363,12 @@ var updateChannelPolicyCommand = cli.Command{ Usage: "the CLTV delta that will be applied to all " + "forwarded HTLCs", }, + cli.Uint64Flag{ + Name: "max_htlc_msat", + Usage: "if set, the max HTLC size that will be applied " + + "to all forwarded HTLCs. If unset, the max HTLC " + + "is left unchanged.", + }, cli.StringFlag{ Name: "chan_point", Usage: "The channel whose fee policy should be " + @@ -3475,6 +3482,7 @@ func updateChannelPolicy(ctx *cli.Context) error { BaseFeeMsat: baseFee, FeeRate: feeRate, TimeLockDelta: uint32(timeLockDelta), + MaxHtlcMsat: ctx.Uint64("max_htlc_msat"), } if chanPoint != nil {