mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
multi-tunnels LeaseSet
This commit is contained in:
parent
dd679c261c
commit
5856310cd6
3 changed files with 26 additions and 13 deletions
17
Tunnel.cpp
17
Tunnel.cpp
|
@ -211,6 +211,23 @@ namespace tunnel
|
|||
}
|
||||
return tunnel;
|
||||
}
|
||||
|
||||
std::vector<InboundTunnel *> Tunnels::GetInboundTunnels (int num) const
|
||||
{
|
||||
std::vector<InboundTunnel *> v;
|
||||
int i = 0;
|
||||
for (auto it : m_InboundTunnels)
|
||||
{
|
||||
if (i >= num) break;
|
||||
if (it.second->GetNextIdentHash () != i2p::context.GetRouterInfo ().GetIdentHash ())
|
||||
{
|
||||
// exclude one hop tunnels
|
||||
v.push_back (it.second);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
OutboundTunnel * Tunnels::GetNextOutboundTunnel ()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue