mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 19:27:49 +02:00
don't recreate tunnels of different size
This commit is contained in:
parent
ab80def94b
commit
1967dee50c
2 changed files with 26 additions and 13 deletions
|
@ -670,10 +670,12 @@ namespace tunnel
|
|||
{
|
||||
if (!tunnel->IsRecreated () && ts + TUNNEL_RECREATION_THRESHOLD > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT)
|
||||
{
|
||||
tunnel->SetIsRecreated ();
|
||||
auto pool = tunnel->GetTunnelPool ();
|
||||
if (pool)
|
||||
if (pool && tunnel->GetPeers().size() == pool->GetNumOutboundHops())
|
||||
{
|
||||
tunnel->SetIsRecreated ();
|
||||
pool->RecreateOutboundTunnel (tunnel);
|
||||
}
|
||||
}
|
||||
if (ts + TUNNEL_EXPIRATION_THRESHOLD > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT)
|
||||
tunnel->SetState (eTunnelStateExpiring);
|
||||
|
@ -723,8 +725,11 @@ namespace tunnel
|
|||
{
|
||||
tunnel->SetIsRecreated ();
|
||||
auto pool = tunnel->GetTunnelPool ();
|
||||
if (pool)
|
||||
if (pool && tunnel->GetPeers().size() == pool->GetNumInboundHops())
|
||||
{
|
||||
tunnel->SetIsRecreated ();
|
||||
pool->RecreateInboundTunnel (tunnel);
|
||||
}
|
||||
}
|
||||
|
||||
if (ts + TUNNEL_EXPIRATION_THRESHOLD > tunnel->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue