mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-18 22:54:25 +01:00
peer subds: ignore failed writes.
In the case where the peer sends an error (and hangs up) immediately after init, connectd *doesn't actually read the error* (even after all the previous fixes so it actually receives the error!). This is because to tried to first write WIRE_CHANNEL_REESTABLISH, and that fails, so it never tries to read. Generally, we should ignore write failures; we'll find out if the socket is closed when we read nothing. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -18,8 +18,9 @@ void peer_write(struct per_peer_state *pps, const void *msg TAKES)
|
|||||||
{
|
{
|
||||||
status_peer_io(LOG_IO_OUT, NULL, msg);
|
status_peer_io(LOG_IO_OUT, NULL, msg);
|
||||||
|
|
||||||
if (!wire_sync_write(pps->peer_fd, msg))
|
/* We ignore write errors; we might still have something to read,
|
||||||
peer_failed_connection_lost();
|
* so we'd rather fail there. */
|
||||||
|
wire_sync_write(pps->peer_fd, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 *peer_read(const tal_t *ctx, struct per_peer_state *pps)
|
u8 *peer_read(const tal_t *ctx, struct per_peer_state *pps)
|
||||||
|
|||||||
Reference in New Issue
Block a user