Browse Source

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

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
1f9ad06056
  1. 4
      lightningd/peer_control.c
  2. 1
      tests/test_lightningd.py

4
lightningd/peer_control.c

@ -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,

1
tests/test_lightningd.py

@ -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'])

Loading…
Cancel
Save