mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Only run InactivityCheck once per second
This commit is contained in:
parent
9e57c35e82
commit
65fb8bc454
@ -1660,15 +1660,22 @@ void CConnman::SocketHandler()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InactivityCheck(pnode);
|
|
||||||
}
|
}
|
||||||
ReleaseNodeVector(vNodesCopy);
|
ReleaseNodeVector(vNodesCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConnman::ThreadSocketHandler()
|
void CConnman::ThreadSocketHandler()
|
||||||
{
|
{
|
||||||
|
int64_t nLastCleanupNodes = 0;
|
||||||
|
|
||||||
while (!interruptNet)
|
while (!interruptNet)
|
||||||
{
|
{
|
||||||
|
if (GetTimeMillis() - nLastCleanupNodes > 1000) {
|
||||||
|
ForEachNode(AllNodes, [&](CNode* pnode) {
|
||||||
|
InactivityCheck(pnode);
|
||||||
|
});
|
||||||
|
nLastCleanupNodes = GetTimeMillis();
|
||||||
|
}
|
||||||
DisconnectNodes();
|
DisconnectNodes();
|
||||||
NotifyNumConnectionsChanged();
|
NotifyNumConnectionsChanged();
|
||||||
SocketHandler();
|
SocketHandler();
|
||||||
|
Loading…
Reference in New Issue
Block a user