Browse Source

cleanup

cl-refactor
subtly 10 years ago
parent
commit
826858496c
  1. 5
      libp2p/Host.cpp

5
libp2p/Host.cpp

@ -639,11 +639,13 @@ void Host::run(boost::system::error_code const&)
if (p->required && reqConn++ < m_idealPeerCount)
connect(p);
if (!m_netPrefs.pin)
{
unsigned pendingCount = 0;
DEV_GUARDED(x_pendingNodeConns)
pendingCount = m_pendingPeerConns.size();
int openSlots = m_idealPeerCount - peerCount() - pendingCount + reqConn;
if (openSlots > 0 && !m_netPrefs.pin)
if (openSlots > 0)
{
for (auto p: toConnect)
if (!p->required && openSlots--)
@ -651,6 +653,7 @@ void Host::run(boost::system::error_code const&)
m_nodeTable->discover();
}
}
auto runcb = [this](boost::system::error_code const& error) { run(error); };
m_timer->expires_from_now(boost::posix_time::milliseconds(c_timerInterval));

Loading…
Cancel
Save