From 79f29ad1ddcd5646686e278ae0049f31dd25d2ef Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 3 Oct 2021 21:44:52 +0000 Subject: [PATCH] Wake reader future when we fail to flush socket buffer --- 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 1067e134692..27ea3d21cf2 100644 --- a/lightning-net-tokio/src/lib.rs +++ b/lightning-net-tokio/src/lib.rs @@ -443,6 +443,9 @@ impl peer_handler::SocketDescriptor for SocketDescriptor { // pause read given we're now waiting on the remote end to ACK (and in // accordance with the send_data() docs). us.read_paused = true; + // Further, to avoid any current pending read causing a `read_event` call, wake + // up the read_waker and restart its loop. + let _ = us.read_waker.try_send(()); return written_len; }, }