From 710d015e5b24fd7c95cfe48f29b6be2a34336ec0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 9 Aug 2019 15:29:12 +0930 Subject: [PATCH] lightningd: fix crash when peer disconnects after fundchannel_start, before cancel/complete Fixes: #2831 Signed-off-by: Rusty Russell --- lightningd/opening_control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index 2eec09f3d..17efc3950 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -99,7 +99,7 @@ static void uncommitted_channel_disconnect(struct uncommitted_channel *uc, u8 *msg = towire_connectctl_peer_disconnected(tmpctx, &uc->peer->id); log_info(uc->log, "%s", desc); subd_send_msg(uc->peer->ld->connectd, msg); - if (uc->fc) + if (uc->fc && uc->fc->cmd) was_pending(command_fail(uc->fc->cmd, LIGHTNINGD, "%s", desc)); notify_disconnect(uc->peer->ld, &uc->peer->id); }