connectd: make sure we do IO logging on final_msg output.

This happens when we send a warning or lightningd tells us to send a
final message then close.  Normally io logging is done by the
subdaemon that creates it, but this is a special case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-03-22 19:20:13 +10:30
parent b99c04e605
commit 9bbb32433e
1 changed files with 2 additions and 0 deletions

View File

@ -577,6 +577,8 @@ static struct io_plan *write_to_peer(struct io_conn *peer_conn,
/* OK, send this then close. */
msg = peer->final_msg;
peer->final_msg = NULL;
/* Wasn't logged earlier, so do it now */
status_peer_io(LOG_IO_OUT, &peer->id, msg);
}
/* Still nothing to send? */