fix meshnet mode:

* don't default to ipv4 when creating router.info
* add i2p::util::config::GetHost for getting host to use from config
* proper check for no transports in Transports.cpp on startup
This commit is contained in:
Jeff Becker 2016-07-14 09:23:33 -04:00
parent 562f320198
commit 3ad196c4c7
No known key found for this signature in database
GPG key ID: AB950234D6EA286B
5 changed files with 41 additions and 42 deletions

View file

@ -49,9 +49,7 @@ namespace i2p
uint16_t port; i2p::config::GetOption("port", port);
if (!port)
port = rand () % (30777 - 9111) + 9111; // I2P network ports range
std::string host; i2p::config::GetOption("host", host);
if (i2p::config::IsDefault("host"))
host = "127.0.0.1"; // replace default address with safe value
std::string host = i2p::util::config::GetHost();
routerInfo.AddSSUAddress (host.c_str(), port, routerInfo.GetIdentHash ());
routerInfo.AddNTCPAddress (host.c_str(), port);
routerInfo.SetCaps (i2p::data::RouterInfo::eReachable |