lncli: Add optional delivery address to close channel
This commit is adapted from @Bluetegu's original pull request #1462.
This commit is contained in:
parent
25caece160
commit
ef4d9334b7
@ -835,11 +835,16 @@ var closeChannelCommand = cli.Command{
|
|||||||
transaction will be broadcast to the network. As a result, any settled
|
transaction will be broadcast to the network. As a result, any settled
|
||||||
funds will be time locked for a few blocks before they can be spent.
|
funds will be time locked for a few blocks before they can be spent.
|
||||||
|
|
||||||
In the case of a cooperative closure, One can manually set the fee to
|
In the case of a cooperative closure, one can manually set the fee to
|
||||||
be used for the closing transaction via either the --conf_target or
|
be used for the closing transaction via either the --conf_target or
|
||||||
--sat_per_byte arguments. This will be the starting value used during
|
--sat_per_byte arguments. This will be the starting value used during
|
||||||
fee negotiation. This is optional.
|
fee negotiation. This is optional.
|
||||||
|
|
||||||
|
In the case of a cooperative closure, one can manually set the address
|
||||||
|
to deliver funds to upon closure. This is optional, and may only be used
|
||||||
|
if an upfront shutdown address has not already been set. If neither are
|
||||||
|
set the funds will be delivered to a new wallet address.
|
||||||
|
|
||||||
To view which funding_txids/output_indexes can be used for a channel close,
|
To view which funding_txids/output_indexes can be used for a channel close,
|
||||||
see the channel_point values within the listchannels command output.
|
see the channel_point values within the listchannels command output.
|
||||||
The format for a channel_point is 'funding_txid:output_index'.`,
|
The format for a channel_point is 'funding_txid:output_index'.`,
|
||||||
@ -874,6 +879,13 @@ var closeChannelCommand = cli.Command{
|
|||||||
"sat/byte that should be used when crafting " +
|
"sat/byte that should be used when crafting " +
|
||||||
"the transaction",
|
"the transaction",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "delivery_addr",
|
||||||
|
Usage: "(optional) an address to deliver funds " +
|
||||||
|
"upon cooperative channel closing, may only " +
|
||||||
|
"be used if an upfront shutdown addresss is not" +
|
||||||
|
"already set",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Action: actionDecorator(closeChannel),
|
Action: actionDecorator(closeChannel),
|
||||||
}
|
}
|
||||||
@ -895,10 +907,11 @@ func closeChannel(ctx *cli.Context) error {
|
|||||||
|
|
||||||
// TODO(roasbeef): implement time deadline within server
|
// TODO(roasbeef): implement time deadline within server
|
||||||
req := &lnrpc.CloseChannelRequest{
|
req := &lnrpc.CloseChannelRequest{
|
||||||
ChannelPoint: channelPoint,
|
ChannelPoint: channelPoint,
|
||||||
Force: ctx.Bool("force"),
|
Force: ctx.Bool("force"),
|
||||||
TargetConf: int32(ctx.Int64("conf_target")),
|
TargetConf: int32(ctx.Int64("conf_target")),
|
||||||
SatPerByte: ctx.Int64("sat_per_byte"),
|
SatPerByte: ctx.Int64("sat_per_byte"),
|
||||||
|
DeliveryAddress: ctx.String("delivery_addr"),
|
||||||
}
|
}
|
||||||
|
|
||||||
// After parsing the request, we'll spin up a goroutine that will
|
// After parsing the request, we'll spin up a goroutine that will
|
||||||
|
Loading…
Reference in New Issue
Block a user