From a9af4589ac1c884807fe5d8a670b7e7b42e0048e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 31 Jul 2015 22:49:43 -0700 Subject: [PATCH] Don't send empty message lists from dispatch. This terminates the write thread. --- src/Dispatcher.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Dispatcher.cpp b/src/Dispatcher.cpp index ca330483e6..ec74d4527f 100644 --- a/src/Dispatcher.cpp +++ b/src/Dispatcher.cpp @@ -159,8 +159,10 @@ void Dispatcher::DispatchThreadMain() { // scan outgoing messages to remove unnecessary updates // send outgoing messages - for (auto& conn : connections) - conn.net->outgoing().emplace(std::move(conn.outgoing)); + for (auto& conn : connections) { + if (!conn.outgoing.empty()) + conn.net->outgoing().emplace(std::move(conn.outgoing)); + } } }