multi-tunnels LeaseSet

This commit is contained in:
orignal 2014-01-14 19:00:12 -05:00
parent dd679c261c
commit 5856310cd6
3 changed files with 26 additions and 13 deletions

View file

@ -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 ()
{