From aec399570b4de31487999ead8c7377bb085f65af Mon Sep 17 00:00:00 2001 From: Intel Date: Sun, 11 May 2014 15:31:50 -0400 Subject: [PATCH 1/2] Tab2Space Round #2 --- src/server/poolserver/Stratum/Client.cpp | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/server/poolserver/Stratum/Client.cpp b/src/server/poolserver/Stratum/Client.cpp index c31868c..589df7f 100644 --- a/src/server/poolserver/Stratum/Client.cpp +++ b/src/server/poolserver/Stratum/Client.cpp @@ -12,26 +12,26 @@ namespace Stratum { bool Client::Start() { - try { - // Get IP - tcp::endpoint remote_ep = _socket.remote_endpoint(); - address remote_ad = remote_ep.address(); - _ip = remote_ad.to_v4().to_ulong(); - - if (_server->IsBanned(_ip)) { - sLog.Warn(LOG_STRATUM, "Blocked banned client from: %s", remote_ad.to_v4().to_string().c_str()); - Disconnect(); - return false; - } - - // Start reading socket - StartRead(); + try { + // Get IP + tcp::endpoint remote_ep = _socket.remote_endpoint(); + address remote_ad = remote_ep.address(); + _ip = remote_ad.to_v4().to_ulong(); + + if (_server->IsBanned(_ip)) { + sLog.Warn(LOG_STRATUM, "Blocked banned client from: %s", remote_ad.to_v4().to_string().c_str()); + Disconnect(); + return false; + } + + // Start reading socket + StartRead(); } catch (std::exception& e) { - sLog.Error(LOG_SERVER, "Exception caught while accepting client: %s", e.what()); - return false; - } - - return true; + sLog.Error(LOG_SERVER, "Exception caught while accepting client: %s", e.what()); + return false; + } + + return true; } void Client::SendJob(bool clean) From 4bcfe3d945dfc29d7f4fdc3bf2add334d1cbbaf2 Mon Sep 17 00:00:00 2001 From: Intel Date: Sun, 11 May 2014 16:37:47 -0400 Subject: [PATCH 2/2] Increase ban threashold. TODO: Implement in settings --- src/server/poolserver/Stratum/ShareLimiter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/poolserver/Stratum/ShareLimiter.cpp b/src/server/poolserver/Stratum/ShareLimiter.cpp index 03041f3..3b5e580 100644 --- a/src/server/poolserver/Stratum/ShareLimiter.cpp +++ b/src/server/poolserver/Stratum/ShareLimiter.cpp @@ -22,7 +22,7 @@ namespace Stratum _lastRetarget = curTime; // Check if miner is ok - if (_totalShares > 50 && (double(_totalBadShares)/double(_totalShares)) > 0.8) { + if (_totalShares > 200 && (double(_totalBadShares)/double(_totalShares)) > 0.9) { _client->Ban(600); return false; }