From 65764dce8cea0c0bf982163b4c153157cea9e9e6 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 9 Mar 2023 17:17:59 +0000 Subject: [PATCH] p2p: do not log to global when re-blocking a subnet --- src/p2p/net_node.inl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 8f5fb4f3d..23a891bfa 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -333,6 +333,7 @@ namespace nodetool limit = std::numeric_limits::max(); else limit = now + seconds; + const bool added = m_blocked_subnets.find(subnet) == m_blocked_subnets.end(); m_blocked_subnets[subnet] = limit; // drop any connection to that subnet. This should only have to look into @@ -365,7 +366,10 @@ namespace nodetool conns.clear(); } - MCLOG_CYAN(el::Level::Info, "global", "Subnet " << subnet.host_str() << " blocked."); + if (added) + MCLOG_CYAN(el::Level::Info, "global", "Subnet " << subnet.host_str() << " blocked."); + else + MINFO("Subnet " << subnet.host_str() << " blocked."); return true; } //-----------------------------------------------------------------------------------