mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-13 04:46:38 +01:00
when routers < 5 and in meshnet mode do not select random peers
This commit is contained in:
parent
926ffe2581
commit
cf3bab996e
1 changed files with 2 additions and 1 deletions
|
@ -331,6 +331,7 @@ namespace tunnel
|
||||||
if (m_ExplicitPeers) return SelectExplicitPeers (peers, isInbound);
|
if (m_ExplicitPeers) return SelectExplicitPeers (peers, isInbound);
|
||||||
auto prevHop = i2p::context.GetSharedRouterInfo ();
|
auto prevHop = i2p::context.GetSharedRouterInfo ();
|
||||||
int numHops = isInbound ? m_NumInboundHops : m_NumOutboundHops;
|
int numHops = isInbound ? m_NumInboundHops : m_NumOutboundHops;
|
||||||
|
#ifndef MESHNET
|
||||||
if (i2p::transport::transports.GetNumPeers () > 25)
|
if (i2p::transport::transports.GetNumPeers () > 25)
|
||||||
{
|
{
|
||||||
auto r = i2p::transport::transports.GetRandomPeer ();
|
auto r = i2p::transport::transports.GetRandomPeer ();
|
||||||
|
@ -341,7 +342,7 @@ namespace tunnel
|
||||||
numHops--;
|
numHops--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
for (int i = 0; i < numHops; i++)
|
for (int i = 0; i < numHops; i++)
|
||||||
{
|
{
|
||||||
auto hop = SelectNextHop (prevHop);
|
auto hop = SelectNextHop (prevHop);
|
||||||
|
|
Loading…
Add table
Reference in a new issue