From 0f7e2ad11ac09ef69679f3f8f0e37d40eccb1dd2 Mon Sep 17 00:00:00 2001 From: hagen Date: Sun, 24 Jan 2016 11:06:54 +0000 Subject: [PATCH] * Daemon_Singleton::init : rewrite setting bandwidth limit and floodfill mode --- Daemon.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Daemon.cpp b/Daemon.cpp index 34a90f9a..22ca2ac1 100644 --- a/Daemon.cpp +++ b/Daemon.cpp @@ -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; }