Browse Source

Fix wrong comparison in peerSlotsAvailable.

cl-refactor
subtly 10 years ago
parent
commit
8b284fea13
  1. 2
      libp2p/Host.h

2
libp2p/Host.h

@ -172,7 +172,7 @@ private:
void connect(std::shared_ptr<Peer> const& _p);
/// Returns true if pending and connected peer count is less than maximum
bool peerSlotsAvailable(PeerSlotRatio _type) { Guard l(x_pendingNodeConns); return peerCount() + m_pendingPeerConns.size() > _type * m_idealPeerCount; }
bool peerSlotsAvailable(PeerSlotRatio _type) { Guard l(x_pendingNodeConns); return peerCount() + m_pendingPeerConns.size() < _type * m_idealPeerCount; }
/// Ping the peers to update the latency information and disconnect peers which have timed out.
void keepAlivePeers();

Loading…
Cancel
Save