Browse Source

Merge branch 'master' into peercoin

peercoin
Intel 11 years ago
parent
commit
c28968a732
  1. 36
      src/server/poolserver/Stratum/Client.cpp
  2. 2
      src/server/poolserver/Stratum/ShareLimiter.cpp

36
src/server/poolserver/Stratum/Client.cpp

@ -12,26 +12,26 @@ namespace Stratum @@ -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;
}
sLog.Error(LOG_SERVER, "Exception caught while accepting client: %s", e.what());
return false;
}
return true;
return true;
}
void Client::SendJob(bool clean)

2
src/server/poolserver/Stratum/ShareLimiter.cpp

@ -22,7 +22,7 @@ namespace Stratum @@ -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;
}

Loading…
Cancel
Save