mirror of
https://github.com/GOSTSec/poolserver
synced 2025-02-06 12:04:29 +00:00
Merge branch 'master' into peercoin
This commit is contained in:
commit
c28968a732
@ -12,26 +12,26 @@ namespace Stratum
|
|||||||
{
|
{
|
||||||
bool Client::Start()
|
bool Client::Start()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
// Get IP
|
// Get IP
|
||||||
tcp::endpoint remote_ep = _socket.remote_endpoint();
|
tcp::endpoint remote_ep = _socket.remote_endpoint();
|
||||||
address remote_ad = remote_ep.address();
|
address remote_ad = remote_ep.address();
|
||||||
_ip = remote_ad.to_v4().to_ulong();
|
_ip = remote_ad.to_v4().to_ulong();
|
||||||
|
|
||||||
if (_server->IsBanned(_ip)) {
|
if (_server->IsBanned(_ip)) {
|
||||||
sLog.Warn(LOG_STRATUM, "Blocked banned client from: %s", remote_ad.to_v4().to_string().c_str());
|
sLog.Warn(LOG_STRATUM, "Blocked banned client from: %s", remote_ad.to_v4().to_string().c_str());
|
||||||
Disconnect();
|
Disconnect();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start reading socket
|
// Start reading socket
|
||||||
StartRead();
|
StartRead();
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
sLog.Error(LOG_SERVER, "Exception caught while accepting client: %s", e.what());
|
sLog.Error(LOG_SERVER, "Exception caught while accepting client: %s", e.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SendJob(bool clean)
|
void Client::SendJob(bool clean)
|
||||||
|
@ -22,7 +22,7 @@ namespace Stratum
|
|||||||
_lastRetarget = curTime;
|
_lastRetarget = curTime;
|
||||||
|
|
||||||
// Check if miner is ok
|
// 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);
|
_client->Ban(600);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user