Merge pull request #5335 from guggero/abandonchannel-no-dev

RPC/CLI: Allow abandonchannel to be used in regular build
This commit is contained in:
Olaoluwa Osuntokun
2021-06-23 16:05:34 -07:00
committed by GitHub
5 changed files with 753 additions and 703 deletions

View File

@@ -1118,7 +1118,9 @@ var abandonChannelCommand = cli.Command{
summary. This method can be used to get rid of permanently unusable
channels due to bugs fixed in newer versions of lnd.
Only available when lnd is built in debug mode.
Only available when lnd is built in debug mode. The flag
--i_know_what_im_doing can be set to override the debug/dev mode
requirement.
To view which funding_txids/output_indexes can be used for this command,
see the channel_point values within the listchannels command output.
@@ -1134,6 +1136,16 @@ var abandonChannelCommand = cli.Command{
Usage: "the output index for the funding output of the funding " +
"transaction",
},
cli.BoolFlag{
Name: "i_know_what_i_am_doing",
Usage: "override the requirement for lnd needing to " +
"be in dev/debug mode to use this command; " +
"when setting this the user attests that " +
"they know the danger of using this command " +
"on channels and that doing so can lead to " +
"loss of funds if the channel funding TX " +
"ever confirms (or was confirmed)",
},
},
Action: actionDecorator(abandonChannel),
}
@@ -1155,7 +1167,8 @@ func abandonChannel(ctx *cli.Context) error {
}
req := &lnrpc.AbandonChannelRequest{
ChannelPoint: channelPoint,
ChannelPoint: channelPoint,
IKnowWhatIAmDoing: ctx.Bool("i_know_what_i_am_doing"),
}
resp, err := client.AbandonChannel(ctxc, req)