From 4cd0e6a391ce9d4c9cb3379b842797f9e80a8791 Mon Sep 17 00:00:00 2001 From: Tibo-lg Date: Wed, 17 Jan 2024 09:20:30 +0900 Subject: [PATCH] Fix lightning-net-tokio sometimes dropping messages --- lightning-net-tokio/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lightning-net-tokio/src/lib.rs b/lightning-net-tokio/src/lib.rs index 1aa2cc25a..be41a2401 100644 --- a/lightning-net-tokio/src/lib.rs +++ b/lightning-net-tokio/src/lib.rs @@ -502,6 +502,9 @@ impl peer_handler::SocketDescriptor for SocketDescriptor { written_len += res; if written_len == data.len() { return written_len; } }, + Err(ref e) if e.kind() == std::io::ErrorKind::WouldBlock => { + continue; + } Err(_) => return written_len, } }, -- 2.39.5