lightningd: allow us to close channel while still awaiting lockin.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-04-03 16:41:20 +09:30 committed by Christian Decker
parent 1773b03380
commit 1f9ad06056
2 changed files with 2 additions and 3 deletions

View File

@ -853,9 +853,9 @@ static void json_close(struct command *cmd,
}
/* Normal case. */
if (channel->state == CHANNELD_NORMAL) {
if (channel->state == CHANNELD_NORMAL || channel->state == CHANNELD_AWAITING_LOCKIN) {
channel_set_state(channel,
CHANNELD_NORMAL, CHANNELD_SHUTTING_DOWN);
channel->state, CHANNELD_SHUTTING_DOWN);
if (channel->owner)
subd_send_msg(channel->owner,

View File

@ -3048,7 +3048,6 @@ class LightningDTests(BaseLightningDTests):
l2.daemon.wait_for_logs(['sendrawtx exit 0', ' to CLOSINGD_COMPLETE'])
assert l1.bitcoin.rpc.getmempoolinfo()['size'] == 1
@unittest.expectedFailure
def test_shutdown_awaiting_lockin(self):
l1 = self.node_factory.get_node()
l2 = self.node_factory.get_node(options=['--anchor-confirms=3'])