|
@ -742,9 +742,14 @@ void Host::keepAlivePeers() |
|
|
return; |
|
|
return; |
|
|
|
|
|
|
|
|
RecursiveGuard l(x_sessions); |
|
|
RecursiveGuard l(x_sessions); |
|
|
for (auto p: m_sessions) |
|
|
for (auto it = m_sessions.begin(); it != m_sessions.end();) |
|
|
if (auto pp = p.second.lock()) |
|
|
if (auto p = it->second.lock()) |
|
|
pp->ping(); |
|
|
{ |
|
|
|
|
|
p->ping(); |
|
|
|
|
|
++it; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
it = m_sessions.erase(it); |
|
|
|
|
|
|
|
|
m_lastPing = chrono::steady_clock::now(); |
|
|
m_lastPing = chrono::steady_clock::now(); |
|
|
} |
|
|
} |
|
|