From 8b71ea924a4112a68fe4a1328885723007e5fe7a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 7 Jul 2017 21:15:42 +0930 Subject: [PATCH] lightningd: don't crash when simply using closingd just for retransmission. test_closing_negotiation_reconnect (__main__.LightningDTests) ... peer state CLOSINGD_COMPLETE should be CLOSINGD_SIGEXCHANGE Signed-off-by: Rusty Russell --- lightningd/peer_control.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 9afaf2e2d..e0d909a20 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -1276,6 +1276,10 @@ static int peer_closing_complete(struct peer *peer, const u8 *msg) return -1; } + /* Retransmission only, ignore closing. */ + if (peer->state == CLOSINGD_COMPLETE) + return -1; + if (!peer->closing_sig_received) { peer_internal_error(peer, "closing_complete without sending sig!");