From 9bd6a10f49f4af5c0ff19ddfd00eb429ddcea2ce Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 31 Aug 2016 16:06:31 +0930 Subject: [PATCH] peer: fix close before their sig has been received in corner case. If we haven't received their closing signature yet, we might try to send the closing packet anyway (and segfault). Make sure we have their signature before trying that. Signed-off-by: Rusty Russell --- daemon/peer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/peer.c b/daemon/peer.c index a1677ff26..8ddcac667 100644 --- a/daemon/peer.c +++ b/daemon/peer.c @@ -1382,7 +1382,7 @@ static bool shutdown_pkt_in(struct peer *peer, const Pkt *pkt) break; } - if (!err && !committed_to_htlcs(peer)) + if (!err && !committed_to_htlcs(peer) && peer->closing.their_script) err = start_closing(peer); if (err)