* Daemon_Singleton::init : rewrite setting bandwidth limit and floodfill mode

This commit is contained in:
hagen 2016-01-24 11:06:54 +00:00
parent 26d232c567
commit 0f7e2ad11a

View file

@ -93,19 +93,20 @@ namespace i2p
i2p::context.SetAcceptsTunnels (!transit);
bool isFloodfill; i2p::config::GetOption("floodfill", isFloodfill);
i2p::context.SetFloodfill (isFloodfill);
char bandwidth; i2p::config::GetOption("bandwidth", bandwidth);
char bandwidth; i2p::config::GetOption("bandwidth", bandwidth);
if (bandwidth != '-')
{
if (isFloodfill) {
LogPrint(eLogInfo, "Daemon: router will be floodfill, bandwidth set to 'extra'");
i2p::context.SetFloodfill (true);
i2p::context.SetExtraBandwidth ();
} else if (bandwidth != '-') {
LogPrint(eLogInfo, "Daemon: bandwidth set to ", bandwidth);
switch (bandwidth) {
case 'P' : i2p::context.SetExtraBandwidth (); break;
case 'L' : i2p::context.SetHighBandwidth (); break;
default : i2p::context.SetLowBandwidth (); break;
}
}
else if (isFloodfill)
i2p::context.SetExtraBandwidth ();
return true;
}