Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix close fail retry #7072

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lightningd/closing_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,8 @@ static struct command_result *json_close(struct command *cmd,
if (close_to_script) {
bool is_p2sh;

if (!tal_arr_eq(close_to_script, channel->shutdown_scriptpubkey[LOCAL])) {
if (!tal_arr_eq(close_to_script, channel->shutdown_scriptpubkey[LOCAL])
&& !cmd->ld->dev_allow_shutdown_destination_change) {
const u8 *defp2tr, *defp2wpkh;
/* We cannot change the closing script once we've
* started shutdown: onchaind relies on it for output
Expand Down
1 change: 1 addition & 0 deletions lightningd/lightningd.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ static struct lightningd *new_lightningd(const tal_t *ctx)
ld->dev_disable_commit = -1;
ld->dev_no_ping_timer = false;
ld->dev_any_channel_type = false;
ld->dev_allow_shutdown_destination_change = false;

/*~ This is a CCAN list: an embedded double-linked list. It's not
* really typesafe, but relies on convention to access the contents.
Expand Down
3 changes: 3 additions & 0 deletions lightningd/lightningd.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ struct lightningd {
/* Tell openingd/dualopend to accept all, allow sending any. */
bool dev_any_channel_type;

/* Allow changing of shutdown output point even if dangerous */
bool dev_allow_shutdown_destination_change;
rustyrussell marked this conversation as resolved.
Show resolved Hide resolved

/* tor support */
struct wireaddr *proxyaddr;
bool always_use_proxy;
Expand Down
4 changes: 4 additions & 0 deletions lightningd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,10 @@ static void dev_register_opts(struct lightningd *ld)
opt_set_bool,
&ld->dev_any_channel_type,
"Allow sending any channel type, and accept any");
clnopt_noarg("--dev-allow-shutdown-destination-change", OPT_DEV,
opt_set_bool,
&ld->dev_allow_shutdown_destination_change,
"Allow destination override on close, even if risky");
}

static const struct config testnet_config = {
Expand Down