From 2a90b2439a5124800f2264cb27164fc6f202803f Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Sat, 10 Sep 2022 12:04:52 -0400 Subject: [PATCH] lncli: channel fee parameter for openchannel --- cmd/lncli/cmd_open_channel.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cmd/lncli/cmd_open_channel.go b/cmd/lncli/cmd_open_channel.go index 150fb0e83..905cf6e36 100644 --- a/cmd/lncli/cmd_open_channel.go +++ b/cmd/lncli/cmd_open_channel.go @@ -104,6 +104,19 @@ var openChannelCommand = cli.Command{ Name: "local_amt", Usage: "the number of satoshis the wallet should commit to the channel", }, + cli.Uint64Flag{ + Name: "base_fee_msat", + Usage: "the base fee in milli-satoshis that will " + + "be charged for each forwarded HTLC, regardless " + + "of payment size", + }, + cli.Uint64Flag{ + Name: "fee_rate_ppm", + Usage: "the fee rate ppm (parts per million) that " + + "will be charged proportionally based on the value of each " + + "forwarded HTLC, the lowest possible rate is 0 " + + "with a granularity of 0.000001 (millionths)", + }, cli.IntFlag{ Name: "push_amt", Usage: "the number of satoshis to give the remote side " + @@ -328,6 +341,16 @@ func openChannel(ctx *cli.Context) error { } } + if ctx.IsSet("base_fee_msat") { + req.BaseFee = ctx.Uint64("base_fee_msat") + req.UseBaseFee = true + } + + if ctx.IsSet("fee_rate_ppm") { + req.FeeRate = ctx.Uint64("fee_rate_ppm") + req.UseFeeRate = true + } + req.Private = ctx.Bool("private") // Parse the channel type and map it to its RPC representation.