|
|
@ -226,12 +226,7 @@ void Host::startPeerSession(Public const& _id, RLP const& _rlp, RLPXFrameIO* _io |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
unsigned pendingCount = 0; |
|
|
|
{ |
|
|
|
Guard l(x_pendingNodeConns); |
|
|
|
pendingCount = m_pendingPeerConns.size(); |
|
|
|
} |
|
|
|
if (peerCount() + pendingCount > 9 * m_idealPeerCount) |
|
|
|
if (peerSlotsAvailable(Ingress)) |
|
|
|
{ |
|
|
|
ps->disconnect(TooManyPeers); |
|
|
|
return; |
|
|
@ -276,12 +271,7 @@ void Host::onNodeTableEvent(NodeId const& _n, NodeTableEventType const& _e) |
|
|
|
clog(NetNote) << "p2p.host.peers.events.peerAdded " << _n << p->endpoint; |
|
|
|
} |
|
|
|
} |
|
|
|
unsigned pendingCount = 0; |
|
|
|
{ |
|
|
|
Guard l(x_pendingNodeConns); |
|
|
|
pendingCount = m_pendingPeerConns.size(); |
|
|
|
} |
|
|
|
if (peerCount() + pendingCount < m_idealPeerCount) |
|
|
|
if (peerSlotsAvailable(Egress)) |
|
|
|
connect(p); |
|
|
|
} |
|
|
|
} |
|
|
@ -588,6 +578,7 @@ void Host::run(boost::system::error_code const&) |
|
|
|
// is always live and to ensure reputation and fallback timers are properly
|
|
|
|
// updated. // disconnectLatePeers();
|
|
|
|
|
|
|
|
// todo: update peerSlotsAvailable()
|
|
|
|
unsigned pendingCount = 0; |
|
|
|
{ |
|
|
|
Guard l(x_pendingNodeConns); |
|
|
|