lightningd: fix crash on failed close.

Fixes: #2056
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-10-28 13:25:02 +10:30
committed by Christian Decker
parent 608b1a236b
commit 322d483b36

View File

@@ -946,9 +946,11 @@ static void json_close(struct command *cmd,
if (channel->state != CHANNELD_NORMAL &&
channel->state != CHANNELD_AWAITING_LOCKIN &&
channel->state != CHANNELD_SHUTTING_DOWN &&
channel->state != CLOSINGD_SIGEXCHANGE)
channel->state != CLOSINGD_SIGEXCHANGE) {
command_fail(cmd, LIGHTNINGD, "Channel is in state %s",
channel_state_name(channel));
return;
}
/* If normal or locking in, transition to shutting down
* state.