sLog.Info(LOG_STRATUM,"Stratum client disconnected from %s. Total clients: %u",asio::ip::address_v4(client->GetIP()).to_string().c_str(),_clients.size());
sLog.Info(LOG_STRATUM,"Stratum client disconnected from %s. Total clients: %u",asio::ip::address_v4(client->GetIP()).to_string().c_str(),_clients.size());
}
}
@ -110,11 +114,15 @@ namespace Stratum
BanInfoban;
BanInfoban;
ban.ip=ip;
ban.ip=ip;
ban.timestamp=Util::Date()+time;
ban.timestamp=Util::Date()+time;
_mtxBans.lock();
_bans.push_back(ban);
_bans.push_back(ban);
_mtxBans.unlock();
}
}
boolIsBanned(uint32ip)
boolIsBanned(uint32ip)
{
{
boost::lock_guard<boost::mutex>guard(_mtxBans);
for(inti=0;i<_bans.size();++i){
for(inti=0;i<_bans.size();++i){
if(_bans[i].ip==ip){
if(_bans[i].ip==ip){
if(_bans[i].timestamp>Util::Date())
if(_bans[i].timestamp>Util::Date())
@ -137,7 +145,10 @@ namespace Stratum
{
{
if(!error){
if(!error){
if(client->Start()){
if(client->Start()){
_mtxClients.lock();
_clients.insert(client);
_clients.insert(client);
_mtxClients.unlock();
sLog.Info(LOG_STRATUM,"New stratum client accepted from %s. Total clients: %u",asio::ip::address_v4(client->GetIP()).to_string().c_str(),_clients.size());
sLog.Info(LOG_STRATUM,"New stratum client accepted from %s. Total clients: %u",asio::ip::address_v4(client->GetIP()).to_string().c_str(),_clients.size());