mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2024-11-16 00:12:43 +00:00
publish 0-hops leaseset
This commit is contained in:
parent
f6721a2ced
commit
e0e50faa47
@ -215,6 +215,15 @@ namespace tunnel
|
|||||||
void TunnelPool::CreateTunnels ()
|
void TunnelPool::CreateTunnels ()
|
||||||
{
|
{
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> l(m_OutboundTunnelsMutex);
|
||||||
|
for (const auto& it : m_OutboundTunnels)
|
||||||
|
if (it->IsEstablished ()) num++;
|
||||||
|
}
|
||||||
|
for (int i = num; i < m_NumOutboundTunnels; i++)
|
||||||
|
CreateOutboundTunnel ();
|
||||||
|
|
||||||
|
num = 0;
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_InboundTunnelsMutex);
|
std::unique_lock<std::mutex> l(m_InboundTunnelsMutex);
|
||||||
for (const auto& it : m_InboundTunnels)
|
for (const auto& it : m_InboundTunnels)
|
||||||
@ -223,14 +232,8 @@ namespace tunnel
|
|||||||
for (int i = num; i < m_NumInboundTunnels; i++)
|
for (int i = num; i < m_NumInboundTunnels; i++)
|
||||||
CreateInboundTunnel ();
|
CreateInboundTunnel ();
|
||||||
|
|
||||||
num = 0;
|
if (num > 0 && m_NumInboundHops <= 0 && m_LocalDestination) // zero hops IB
|
||||||
{
|
m_LocalDestination->SetLeaseSetUpdated (); // update LeaseSet immediately
|
||||||
std::unique_lock<std::mutex> l(m_OutboundTunnelsMutex);
|
|
||||||
for (const auto& it : m_OutboundTunnels)
|
|
||||||
if (it->IsEstablished ()) num++;
|
|
||||||
}
|
|
||||||
for (int i = num; i < m_NumOutboundTunnels; i++)
|
|
||||||
CreateOutboundTunnel ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TunnelPool::TestTunnels ()
|
void TunnelPool::TestTunnels ()
|
||||||
|
Loading…
Reference in New Issue
Block a user