diff options
author | Manuel Stoeckl <code@mstoeckl.com> | 2022-10-01 15:20:43 -0400 |
---|---|---|
committer | Manuel Stoeckl <code@mstoeckl.com> | 2022-10-01 15:20:54 -0400 |
commit | f22700cfd52eec593c4fae7af4f7b77175b02554 (patch) | |
tree | d5446273820c59a1e70180f1f1f43f6eff932dd9 | |
parent | 232c4ac954cfced2411a7ab461e04f2f4569fcfe (diff) |
Remove unnecessary delay
-rw-r--r-- | src/mainloop.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mainloop.c b/src/mainloop.c index 4ec806e..181319c 100644 --- a/src/mainloop.c +++ b/src/mainloop.c @@ -1292,15 +1292,16 @@ int main_interface_loop(int chanfd, int progfd, int linkfd, chan_msg.state == CM_WAITING_FOR_CHANNEL && chan_msg.recv_unhandled_messages > 0; - int poll_delay = -1; + int poll_delay; if (unread_chan_msgs) { /* There is work to do, so continue */ poll_delay = 0; - } - if (own_msg_pending) { + } else if (own_msg_pending) { /* To coalesce acknowledgements, we wait for a minimum * amount */ poll_delay = 20; + } else { + poll_delay = -1; } int r = poll(pfds, (nfds_t)npoll, poll_delay); if (r == -1) { |