channeld: fix shutdown when we have to complete HTLCs.

We need to check if we exit after sending a revoke_and_ack, otherwise
channeld ends up getting the closing_signed packet.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-08-18 14:13:39 +09:30
parent f5624af965
commit 217df2d2e8

View File

@ -701,6 +701,10 @@ static struct io_plan *send_revocation(struct io_conn *conn, struct peer *peer)
msg_enqueue(&peer->peer_out, take(msg));
/* This might have been the final revoke_and_ack... */
if (shutdown_complete(peer))
io_break(peer);
return peer_read_message(conn, &peer->pcs, peer_in);
}