aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-12-31 02:05:21 -0500
committerCory Fields <cory-nospam-@coryfields.com>2017-01-12 23:05:09 -0500
commitef7b5ecbb73e9fd3670494c99cfc13ccf3574170 (patch)
tree9976c03d3c259e0b24a1313453b806c674049655
parentf5c36d19b636f01cc24417bc2b2f5b226ff3dd2c (diff)
net: Add a simple function for waking the message handler
This may be used publicly in the future
-rw-r--r--src/net.cpp10
-rw-r--r--src/net.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 312a6e0940..36db77abb6 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1239,8 +1239,8 @@ void CConnman::ThreadSocketHandler()
if (!pnode->ReceiveMsgBytes(pchBuf, nBytes, notify))
pnode->CloseSocketDisconnect();
RecordBytesRecv(nBytes);
- if(notify)
- condMsgProc.notify_one();
+ if (notify)
+ WakeMessageHandler();
}
else if (nBytes == 0)
{
@@ -1315,8 +1315,10 @@ void CConnman::ThreadSocketHandler()
}
}
-
-
+void CConnman::WakeMessageHandler()
+{
+ condMsgProc.notify_one();
+}
diff --git a/src/net.h b/src/net.h
index 6c12171bf2..cc79cce852 100644
--- a/src/net.h
+++ b/src/net.h
@@ -341,6 +341,8 @@ private:
void ThreadSocketHandler();
void ThreadDNSAddressSeed();
+ void WakeMessageHandler();
+
uint64_t CalculateKeyedNetGroup(const CAddress& ad);
CNode* FindNode(const CNetAddr& ip);