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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-07-07 21:15:42 +09:30
parent 7dce850844
commit 8b71ea924a

View file

@ -1276,6 +1276,10 @@ static int peer_closing_complete(struct peer *peer, const u8 *msg)
return -1; return -1;
} }
/* Retransmission only, ignore closing. */
if (peer->state == CLOSINGD_COMPLETE)
return -1;
if (!peer->closing_sig_received) { if (!peer->closing_sig_received) {
peer_internal_error(peer, peer_internal_error(peer,
"closing_complete without sending sig!"); "closing_complete without sending sig!");