various: minor cleanups from Christian's review.

More significant things have been folded.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-01-11 11:45:58 +10:30
parent 39c93ee6e5
commit 26b9384fd0
4 changed files with 10 additions and 7 deletions

View File

@ -86,7 +86,7 @@ u8 *gossip_store_next(const tal_t *ctx,
if (checksum != crc32c(be32_to_cpu(hdr.timestamp), msg, msglen))
status_failed(STATUS_FAIL_INTERNAL_ERROR,
"gossip_store: bad checksum offset %zu"
"gossip_store: bad checksum at offset %zu"
": %s",
*off, tal_hex(tmpctx, msg));

View File

@ -24,11 +24,11 @@ void peer_write(struct per_peer_state *pps, const void *msg TAKES)
u8 *peer_read(const tal_t *ctx, struct per_peer_state *pps)
{
u8 *dec = wire_sync_read(ctx, pps->peer_fd);
if (!dec)
u8 *msg = wire_sync_read(ctx, pps->peer_fd);
if (!msg)
peer_failed_connection_lost();
status_peer_io(LOG_IO_IN, NULL, dec);
status_peer_io(LOG_IO_IN, NULL, msg);
return dec;
return msg;
}

View File

@ -47,7 +47,7 @@ struct peer {
/* Final message to send to peer (and hangup) */
u8 *final_msg;
/* When we write something which wants Nagle overridden */
/* When socket has Nagle overridden */
bool urgent;
/* Input buffers. */

View File

@ -481,8 +481,11 @@ static struct io_plan *read_body_from_peer_done(struct io_conn *peer_conn,
decrypted = cryptomsg_decrypt_body(NULL, &peer->cs,
peer->peer_in);
if (!decrypted)
if (!decrypted) {
status_peer_debug(&peer->id, "Bad encrypted packet len %zu",
tal_bytelen(peer->peer_in));
return io_close(peer_conn);
}
tal_free(peer->peer_in);
/* If we swallow this, just try again. */