mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
fixed crash if no routers available
This commit is contained in:
parent
19325d552a
commit
321dd252ea
2 changed files with 20 additions and 12 deletions
|
@ -297,6 +297,11 @@ namespace tunnel
|
|||
for (int i = 0; i < numHops; i++)
|
||||
{
|
||||
auto hop = SelectNextHop (prevHop);
|
||||
if (!hop)
|
||||
{
|
||||
LogPrint (eLogError, "Can't select next hop for inbound tunnel");
|
||||
return;
|
||||
}
|
||||
prevHop = hop;
|
||||
hops.push_back (hop);
|
||||
}
|
||||
|
@ -329,6 +334,11 @@ namespace tunnel
|
|||
for (int i = 0; i < m_NumOutboundHops; i++)
|
||||
{
|
||||
auto hop = SelectNextHop (prevHop);
|
||||
if (!hop)
|
||||
{
|
||||
LogPrint (eLogError, "Can't select next hop for outbound tunnel");
|
||||
return;
|
||||
}
|
||||
prevHop = hop;
|
||||
hops.push_back (hop);
|
||||
}
|
||||
|
@ -338,7 +348,7 @@ namespace tunnel
|
|||
tunnel->SetTunnelPool (shared_from_this ());
|
||||
}
|
||||
else
|
||||
LogPrint ("Can't create outbound tunnel. No inbound tunnels found");
|
||||
LogPrint (eLogError, "Can't create outbound tunnel. No inbound tunnels found");
|
||||
}
|
||||
|
||||
void TunnelPool::RecreateOutboundTunnel (std::shared_ptr<OutboundTunnel> tunnel)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue