mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-29 18:53:14 +00:00
p2p: do not log to global when re-blocking a subnet
This commit is contained in:
parent
f0e326be58
commit
c4cfaa4567
1 changed files with 5 additions and 1 deletions
|
@ -333,6 +333,7 @@ namespace nodetool
|
||||||
limit = std::numeric_limits<time_t>::max();
|
limit = std::numeric_limits<time_t>::max();
|
||||||
else
|
else
|
||||||
limit = now + seconds;
|
limit = now + seconds;
|
||||||
|
const bool added = m_blocked_subnets.find(subnet) == m_blocked_subnets.end();
|
||||||
m_blocked_subnets[subnet] = limit;
|
m_blocked_subnets[subnet] = limit;
|
||||||
|
|
||||||
// drop any connection to that subnet. This should only have to look into
|
// drop any connection to that subnet. This should only have to look into
|
||||||
|
@ -365,7 +366,10 @@ namespace nodetool
|
||||||
conns.clear();
|
conns.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (added)
|
||||||
MCLOG_CYAN(el::Level::Info, "global", "Subnet " << subnet.host_str() << " blocked.");
|
MCLOG_CYAN(el::Level::Info, "global", "Subnet " << subnet.host_str() << " blocked.");
|
||||||
|
else
|
||||||
|
MINFO("Subnet " << subnet.host_str() << " blocked.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//-----------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue