mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
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:
parent
39c93ee6e5
commit
26b9384fd0
@ -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));
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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. */
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user