#818. Exploratory config

This commit is contained in:
orignal 2017-02-28 15:58:53 -05:00
parent 319f72ae2a
commit 60ed43c11b
2 changed files with 14 additions and 1 deletions

View File

@ -210,6 +210,13 @@ namespace config {
("websockets.address", value<std::string>()->default_value("127.0.0.1"), "address to bind websocket server on")
("websockets.port", value<uint16_t>()->default_value(7666), "port to bind websocket server on");
options_description exploratory("Exploratory Options");
exploratory.add_options()
("exploratory.inbound.length", value<int>()->default_value(2), "Exploratory inbound tunnel length")
("exploratory.outbound.length", value<int>()->default_value(2), "Exploratory outbound tunnel length")
("exploratory.inbound.quantity", value<int>()->default_value(3), "Exploratory inbound tunnels quantity")
("exploratory.outbound.quantity", value<int>()->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)
;
}

View File

@ -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;