aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_node.inl
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2023-03-09 17:17:59 +0000
committerselsta <selsta@sent.at>2023-03-19 02:58:38 +0100
commitc4cfaa4567106d53f397b1e61f9ed9ea76dae579 (patch)
tree0461fd83589b20a8ed92efb589bc831b176d2374 /src/p2p/net_node.inl
parentp2p: avoid spam blocking ipv4 addresses in a blocked subnet (diff)
downloadmonero-c4cfaa4567106d53f397b1e61f9ed9ea76dae579.tar.xz
p2p: do not log to global when re-blocking a subnet
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r--src/p2p/net_node.inl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 733c7acf7..30e3d31b9 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -333,6 +333,7 @@ namespace nodetool
limit = std::numeric_limits<time_t>::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;
}
//-----------------------------------------------------------------------------------