lncli: fix line length issues

This commit is contained in:
Slyghtning 2023-01-16 09:35:22 +10:30
parent 38dc67e1ef
commit 9e8ee618e3

View File

@ -74,56 +74,63 @@ var openChannelCommand = cli.Command{
One can also connect to a node before opening a new channel to it by One can also connect to a node before opening a new channel to it by
setting its host:port via the --connect argument. For this to work, setting its host:port via the --connect argument. For this to work,
the node_key must be provided, rather than the peer_id. This is optional. the node_key must be provided, rather than the peer_id. This is
optional.
The channel will be initialized with local-amt satoshis local and push-amt The channel will be initialized with local-amt satoshis locally and
satoshis for the remote node. Note that specifying push-amt means you give that push-amt satoshis for the remote node. Note that the push-amt is
amount to the remote node as part of the channel opening. Once the channel is open, deducted from the specified local-amt which implies that the local-amt
a channelPoint (txid:vout) of the funding output is returned. must be greater than the push-amt. Also note that specifying push-amt
means you give that 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 If the remote peer supports the option upfront shutdown feature bit
listpeers to see their supported feature bits), an address to enforce (query listpeers to see their supported feature bits), an address to
payout of funds on cooperative close can optionally be provided. Note that enforce payout of funds on cooperative close can optionally be provided.
if you set this value, you will not be able to cooperatively close out to Note that if you set this value, you will not be able to cooperatively
another address. close out to another address.
One can manually set the fee to be used for the funding transaction via either One can manually set the fee to be used for the funding transaction via
the --conf_target or --sat_per_vbyte arguments. This is optional.`, either the --conf_target or --sat_per_vbyte arguments. This is
optional.`,
ArgsUsage: "node-key local-amt push-amt", ArgsUsage: "node-key local-amt push-amt",
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.StringFlag{ cli.StringFlag{
Name: "node_key", Name: "node_key",
Usage: "the identity public key of the target node/peer " + Usage: "the identity public key of the target " +
"serialized in compressed format", "node/peer serialized in compressed format",
}, },
cli.StringFlag{ cli.StringFlag{
Name: "connect", Name: "connect",
Usage: "(optional) the host:port of the target node", Usage: "(optional) the host:port of the target node",
}, },
cli.IntFlag{ cli.IntFlag{
Name: "local_amt", Name: "local_amt",
Usage: "the number of satoshis the wallet should commit to the channel", Usage: "the number of satoshis the wallet should " +
"commit to the channel",
}, },
cli.Uint64Flag{ cli.Uint64Flag{
Name: "base_fee_msat", Name: "base_fee_msat",
Usage: "the base fee in milli-satoshis that will " + Usage: "the base fee in milli-satoshis that will " +
"be charged for each forwarded HTLC, regardless " + "be charged for each forwarded HTLC, " +
"of payment size", "regardless of payment size",
}, },
cli.Uint64Flag{ cli.Uint64Flag{
Name: "fee_rate_ppm", Name: "fee_rate_ppm",
Usage: "the fee rate ppm (parts per million) that " + Usage: "the fee rate ppm (parts per million) that " +
"will be charged proportionally based on the value of each " + "will be charged proportionally based on the " +
"forwarded HTLC, the lowest possible rate is 0 " + "value of each forwarded HTLC, the lowest " +
"with a granularity of 0.000001 (millionths)", "possible rate is 0 with a granularity of " +
"0.000001 (millionths)",
}, },
cli.IntFlag{ cli.IntFlag{
Name: "push_amt", Name: "push_amt",
Usage: "the number of satoshis to give the remote side " + Usage: "the number of satoshis to give the remote " +
"as part of the initial commitment state, " + "side as part of the initial commitment " +
"this is equivalent to first opening a " + "state, this is equivalent to first opening " +
"channel and sending the remote party funds, " + "a channel and sending the remote party " +
"but done all in one step", "funds, but done all in one step",
}, },
cli.BoolFlag{ cli.BoolFlag{
Name: "block", Name: "block",
@ -161,10 +168,11 @@ var openChannelCommand = cli.Command{
}, },
cli.Uint64Flag{ cli.Uint64Flag{
Name: "remote_csv_delay", Name: "remote_csv_delay",
Usage: "(optional) the number of blocks we will require " + Usage: "(optional) the number of blocks we will " +
"our channel counterparty to wait before accessing " + "require our channel counterparty to wait " +
"its funds in case of unilateral close. If this is " + "before accessing its funds in case of " +
"not set, we will scale the value according to the " + "unilateral close. If this is not set, we " +
"will scale the value according to the " +
"channel size", "channel size",
}, },
cli.Uint64Flag{ cli.Uint64Flag{
@ -176,25 +184,26 @@ var openChannelCommand = cli.Command{
}, },
cli.Uint64Flag{ cli.Uint64Flag{
Name: "min_confs", Name: "min_confs",
Usage: "(optional) the minimum number of confirmations " + Usage: "(optional) the minimum number of " +
"each one of your outputs used for the funding " + "confirmations each one of your outputs used " +
"transaction must satisfy", "for the funding transaction must satisfy",
Value: defaultUtxoMinConf, Value: defaultUtxoMinConf,
}, },
cli.StringFlag{ cli.StringFlag{
Name: "close_address", Name: "close_address",
Usage: "(optional) an address to enforce payout of our " + Usage: "(optional) an address to enforce payout of " +
"funds to on cooperative close. Note that if this " + "our funds to on cooperative close. Note " +
"value is set on channel open, you will *not* be " + "that if this value is set on channel open, " +
"able to cooperatively close to a different address.", "you will *not* be able to cooperatively " +
"close to a different address.",
}, },
cli.BoolFlag{ cli.BoolFlag{
Name: "psbt", Name: "psbt",
Usage: "start an interactive mode that initiates " + Usage: "start an interactive mode that initiates " +
"funding through a partially signed bitcoin " + "funding through a partially signed bitcoin " +
"transaction (PSBT), allowing the channel " + "transaction (PSBT), allowing the channel " +
"funds to be added and signed from a hardware " + "funds to be added and signed from a " +
"or other offline device.", "hardware or other offline device.",
}, },
cli.StringFlag{ cli.StringFlag{
Name: "base_psbt", Name: "base_psbt",
@ -215,7 +224,8 @@ var openChannelCommand = cli.Command{
cli.Uint64Flag{ cli.Uint64Flag{
Name: "remote_max_value_in_flight_msat", Name: "remote_max_value_in_flight_msat",
Usage: "(optional) the maximum value in msat that " + Usage: "(optional) the maximum value in msat that " +
"can be pending within the channel at any given time", "can be pending within the channel at any " +
"given time",
}, },
cli.StringFlag{ cli.StringFlag{
Name: "channel_type", Name: "channel_type",
@ -288,14 +298,16 @@ func openChannel(ctx *cli.Context) error {
case ctx.IsSet("node_key"): case ctx.IsSet("node_key"):
nodePubHex, err := hex.DecodeString(ctx.String("node_key")) nodePubHex, err := hex.DecodeString(ctx.String("node_key"))
if err != nil { if err != nil {
return fmt.Errorf("unable to decode node public key: %v", err) return fmt.Errorf("unable to decode node public key: "+
"%v", err)
} }
req.NodePubkey = nodePubHex req.NodePubkey = nodePubHex
case args.Present(): case args.Present():
nodePubHex, err := hex.DecodeString(args.First()) nodePubHex, err := hex.DecodeString(args.First())
if err != nil { if err != nil {
return fmt.Errorf("unable to decode node public key: %v", err) return fmt.Errorf("unable to decode node public key: "+
"%v", err)
} }
args = args.Tail() args = args.Tail()
req.NodePubkey = nodePubHex req.NodePubkey = nodePubHex
@ -331,7 +343,9 @@ func openChannel(ctx *cli.Context) error {
case ctx.IsSet("local_amt"): case ctx.IsSet("local_amt"):
req.LocalFundingAmount = int64(ctx.Int("local_amt")) req.LocalFundingAmount = int64(ctx.Int("local_amt"))
case args.Present(): case args.Present():
req.LocalFundingAmount, err = strconv.ParseInt(args.First(), 10, 64) req.LocalFundingAmount, err = strconv.ParseInt(
args.First(), 10, 64,
)
if err != nil { if err != nil {
return fmt.Errorf("unable to decode local amt: %v", err) return fmt.Errorf("unable to decode local amt: %v", err)
} }
@ -560,7 +574,10 @@ func openChannelPsbt(rpcCtx context.Context, ctx *cli.Context,
// remove it again, this would just produce another // remove it again, this would just produce another
// error. // error.
cancelErr := chanfunding.ErrRemoteCanceled.Error() cancelErr := chanfunding.ErrRemoteCanceled.Error()
if err != nil && strings.Contains(err.Error(), cancelErr) { if err != nil && strings.Contains(
err.Error(), cancelErr,
) {
shimPending = false shimPending = false
} }
close(quit) close(quit)
@ -996,7 +1013,8 @@ func sendFundingState(cancelCtx context.Context, cliCtx *cli.Context,
// from either a hex encoded raw wire transaction or a base64/binary encoded // from either a hex encoded raw wire transaction or a base64/binary encoded
// PSBT packet. // PSBT packet.
func finalizeMsgFromString(tx string, func finalizeMsgFromString(tx string,
pendingChanID []byte) (*lnrpc.FundingTransitionMsg_PsbtFinalize, error) { pendingChanID []byte) (*lnrpc.FundingTransitionMsg_PsbtFinalize,
error) {
psbtBytes, err := decodePsbt(tx) psbtBytes, err := decodePsbt(tx)
if err == nil { if err == nil {