Browse Source

limit number of transit tunnels

pull/163/head
orignal 9 years ago
parent
commit
1a307f3093
  1. 3
      I2NPProtocol.cpp
  2. 2
      I2NPProtocol.h
  3. 2
      I2PControl.cpp

3
I2NPProtocol.cpp

@ -280,7 +280,8 @@ namespace i2p @@ -280,7 +280,8 @@ namespace i2p
i2p::crypto::ElGamalDecrypt (i2p::context.GetEncryptionPrivateKey (), record + BUILD_REQUEST_RECORD_ENCRYPTED_OFFSET, clearText);
// replace record to reply
if (i2p::context.AcceptsTunnels ())
if (i2p::context.AcceptsTunnels () &&
i2p::tunnel::tunnels.GetTransitTunnels ().size () <= MAX_NUM_TRANSIT_TUNNELS)
{
i2p::tunnel::TransitTunnel * transitTunnel =
i2p::tunnel::CreateTransitTunnel (

2
I2NPProtocol.h

@ -97,6 +97,8 @@ namespace i2p @@ -97,6 +97,8 @@ namespace i2p
const uint8_t DATABASE_LOOKUP_TYPE_ROUTERINFO_LOOKUP = 0x08; // 1000
const uint8_t DATABASE_LOOKUP_TYPE_EXPLORATORY_LOOKUP = 0x0C; // 1100
const int MAX_NUM_TRANSIT_TUNNELS = 1500;
namespace tunnel
{
class InboundTunnel;

2
I2PControl.cpp

@ -309,7 +309,7 @@ namespace client @@ -309,7 +309,7 @@ namespace client
void I2PControlService::TunnelsParticipatingHandler (std::map<std::string, std::string>& results)
{
results[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = boost::lexical_cast<std::string>(i2p::tunnel::tunnels.GetTransitTunnels ().size ());;
results[I2P_CONTROL_ROUTER_INFO_TUNNELS_PARTICIPATING] = boost::lexical_cast<std::string>(i2p::tunnel::tunnels.GetTransitTunnels ().size ());
}
// RouterManager

Loading…
Cancel
Save