From f13914a0e9cf533d77dc870719842aa426a7926c Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 14 Jan 2017 16:00:00 -0800 Subject: [PATCH 1/2] Make WakeMessageHandler public --- src/net.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net.h b/src/net.h index 2baf82702..a9da38146 100644 --- a/src/net.h +++ b/src/net.h @@ -328,6 +328,8 @@ public: CSipHasher GetDeterministicRandomizer(uint64_t id); unsigned int GetReceiveFloodSize() const; + + void WakeMessageHandler(); private: struct ListenSocket { SOCKET socket; @@ -344,8 +346,6 @@ private: void ThreadSocketHandler(); void ThreadDNSAddressSeed(); - void WakeMessageHandler(); - uint64_t CalculateKeyedNetGroup(const CAddress& ad); CNode* FindNode(const CNetAddr& ip); From 241d8938f4b5de1d2564ec7e064d8b0b8efd84a4 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 14 Jan 2017 15:50:28 -0800 Subject: [PATCH 2/2] Wake message handling thread when we receive a new block This forces the message handling thread to make another full iteration of SendMessages prior to going back to sleep, ensuring we announce the new block to all peers before sleeping. --- src/net_processing.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 59c1d1bf8..c19bf8157 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -822,6 +822,7 @@ void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, const CB } } }); + connman->WakeMessageHandler(); } nTimeBestReceived = GetTime();