1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-19 01:09:58 +00:00

allow 0 hops with explicitPeers

This commit is contained in:
Vort 2023-07-19 16:38:04 +03:00
parent 0754255c1f
commit f13cc0b862

View File

@ -570,9 +570,9 @@ namespace tunnel
bool TunnelPool::SelectExplicitPeers (Path& path, bool isInbound) bool TunnelPool::SelectExplicitPeers (Path& path, bool isInbound)
{ {
if (!m_ExplicitPeers->size ()) return false;
int numHops = isInbound ? m_NumInboundHops : m_NumOutboundHops; int numHops = isInbound ? m_NumInboundHops : m_NumOutboundHops;
if (numHops > (int)m_ExplicitPeers->size ()) numHops = m_ExplicitPeers->size (); if (numHops > (int)m_ExplicitPeers->size ()) numHops = m_ExplicitPeers->size ();
if (!numHops) return false;
for (int i = 0; i < numHops; i++) for (int i = 0; i < numHops; i++)
{ {
auto& ident = (*m_ExplicitPeers)[i]; auto& ident = (*m_ExplicitPeers)[i];