From 373e445cdc775e283fc520c3bb4bf3be9260cdb8 Mon Sep 17 00:00:00 2001 From: shaurya947 Date: Wed, 3 May 2023 15:36:43 -0400 Subject: [PATCH] lncli: add optional memo flag to openchannel cmd This commit simply adds a new memo flag to the openchannel command. Memo could be any note-to-self kind of useful information to go along with the channel. The value isn't used yet, will be in the next commit. --- cmd/lncli/cmd_open_channel.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cmd/lncli/cmd_open_channel.go b/cmd/lncli/cmd_open_channel.go index b36676cef..5e1bea4d0 100644 --- a/cmd/lncli/cmd_open_channel.go +++ b/cmd/lncli/cmd_open_channel.go @@ -93,7 +93,12 @@ var openChannelCommand = cli.Command{ One can manually set the fee to be used for the funding transaction via either the --conf_target or --sat_per_vbyte arguments. This is - optional.`, + optional. + + One can also specify a short string memo to record some useful + information about the channel using the --memo argument. This is stored + locally only, and is purely for reference. It has no bearing on the + channel's operation. Max allowed length is 500 characters.`, ArgsUsage: "node-key local-amt push-amt", Flags: []cli.Flag{ cli.StringFlag{ @@ -257,6 +262,14 @@ var openChannelCommand = cli.Command{ "payment. If not specified, a default of 1% " + "of the channel capacity will be used.", }, + cli.StringFlag{ + Name: "memo", + Usage: `(optional) a note-to-self containing some useful + information about the channel. This is stored + locally only, and is purely for reference. It + has no bearing on the channel's operation. Max + allowed length is 500 characters`, + }, }, Action: actionDecorator(openChannel), } @@ -300,6 +313,7 @@ func openChannel(ctx *cli.Context) error { ScidAlias: ctx.Bool("scid_alias"), RemoteChanReserveSat: ctx.Uint64("remote_reserve_sats"), FundMax: ctx.Bool("fundmax"), + Memo: ctx.String("memo"), } switch {