Skip to content

Commit

Permalink
p2p: do not log to global when re-blocking a subnet
Browse files Browse the repository at this point in the history
  • Loading branch information
moneromooo-monero authored and selsta committed Mar 19, 2023
1 parent f0e326b commit c4cfaa4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/p2p/net_node.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
//-----------------------------------------------------------------------------------
Expand Down

0 comments on commit c4cfaa4

Please sign in to comment.