From c27d60b6d115588154287e0fda2ff2d354265b5f Mon Sep 17 00:00:00 2001 From: carla Date: Tue, 17 Dec 2019 21:58:28 +0200 Subject: [PATCH] lncli: add option upfront shutdown to openchannel --- cmd/lncli/commands.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 8d346ec0..7b8c4b0b 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -590,6 +590,12 @@ var openChannelCommand = cli.Command{ amount to the remote node as part of the channel opening. Once the channel is open, a channelPoint (txid:vout) of the funding output is returned. + If the remote peer supports the option upfront shutdown feature bit (query + listpeers to see their supported feature bits), an address to enforce + payout of funds on cooperative close can optionally be provided. Note that + if you set this value, you will not be able to cooperatively close out to + another address. + One can manually set the fee to be used for the funding transaction via either the --conf_target or --sat_per_byte arguments. This is optional.`, ArgsUsage: "node-key local-amt push-amt", @@ -659,6 +665,13 @@ var openChannelCommand = cli.Command{ "transaction must satisfy", Value: 1, }, + cli.StringFlag{ + Name: "close_address", + Usage: "(optional) an address to enforce payout of our " + + "funds to on cooperative close. Note that if this " + + "value is set on channel open, you will *not* be " + + "able to cooperatively close to a different address.", + }, }, Action: actionDecorator(openChannel), } @@ -686,6 +699,7 @@ func openChannel(ctx *cli.Context) error { RemoteCsvDelay: uint32(ctx.Uint64("remote_csv_delay")), MinConfs: minConfs, SpendUnconfirmed: minConfs == 0, + CloseAddress: ctx.String("close_address"), } switch {