diff --git a/Config.cpp b/Config.cpp index 7f8f2f53..10c55e8f 100644 --- a/Config.cpp +++ b/Config.cpp @@ -210,6 +210,13 @@ namespace config { ("websockets.address", value()->default_value("127.0.0.1"), "address to bind websocket server on") ("websockets.port", value()->default_value(7666), "port to bind websocket server on"); + options_description exploratory("Exploratory Options"); + exploratory.add_options() + ("exploratory.inbound.length", value()->default_value(2), "Exploratory inbound tunnel length") + ("exploratory.outbound.length", value()->default_value(2), "Exploratory outbound tunnel length") + ("exploratory.inbound.quantity", value()->default_value(3), "Exploratory inbound tunnels quantity") + ("exploratory.outbound.quantity", value()->default_value(3), "Exploratory outbound tunnels quantity"); + m_OptionsDesc .add(general) .add(limits) @@ -226,6 +233,7 @@ namespace config { .add(addressbook) .add(trust) .add(websocket) + .add(exploratory) ; } diff --git a/Tunnel.cpp b/Tunnel.cpp index 6f9346d2..390c64ac 100644 --- a/Tunnel.cpp +++ b/Tunnel.cpp @@ -10,6 +10,7 @@ #include "I2NPProtocol.h" #include "Transports.h" #include "NetDb.h" +#include "Config.h" #include "Tunnel.h" #include "TunnelPool.h" #ifdef WITH_EVENTS @@ -741,7 +742,11 @@ namespace tunnel CreateZeroHopsOutboundTunnel (); if (!m_ExploratoryPool) { - m_ExploratoryPool = CreateTunnelPool (2, 2, 3, 3); // 2-hop exploratory, 3 tunnels + int ibLen; i2p::config::GetOption("exploratory.inbound.length", ibLen); + int obLen; i2p::config::GetOption("exploratory.outbound.length", obLen); + int ibNum; i2p::config::GetOption("exploratory.inbound.quantity", ibNum); + int obNum; i2p::config::GetOption("exploratory.outbound.quantity", obNum); + m_ExploratoryPool = CreateTunnelPool (ibLen, obLen, ibNum, obNum); m_ExploratoryPool->SetLocalDestination (i2p::context.GetSharedDestination ()); } return;