mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32: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);
|
||||
}
|
||||
|
||||
void CConnman::ThreadSocketHandler()
|
||||
{
|
||||
int64_t nLastCleanupNodes = 0;
|
||||
|
||||
while (!interruptNet)
|
||||
{
|
||||
if (GetTimeMillis() - nLastCleanupNodes > 1000) {
|
||||
ForEachNode(AllNodes, [&](CNode* pnode) {
|
||||
InactivityCheck(pnode);
|
||||
});
|
||||
nLastCleanupNodes = GetTimeMillis();
|
||||
}
|
||||
DisconnectNodes();
|
||||
NotifyNumConnectionsChanged();
|
||||
SocketHandler();
|
||||
|
Loading…
Reference in New Issue
Block a user