Skip to content

Commit

Permalink
Add messages at node's addition to block list, and at finding node on…
Browse files Browse the repository at this point in the history
… block list
  • Loading branch information
who-biz committed Jul 24, 2019
1 parent 49de156 commit 9f8a0a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/p2p/net_node.inl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ namespace nodetool
for (const auto &c: conns)
m_net_server.get_config_object().close(c);

MCLOG_CYAN(el::Level::Info, "global", "Host " << addr.host_str() << " blocked.");
MCLOG_CYAN(el::Level::Info, "global", "Host " << addr.host_str() << " blocked due to host being found on block list.");
return true;
}
//-----------------------------------------------------------------------------------
Expand All @@ -195,8 +195,10 @@ namespace nodetool
{
auto it = m_host_fails_score.find(address.host_str());
CHECK_AND_ASSERT_MES(it != m_host_fails_score.end(), false, "internal error");
if ((it->second) >= 9)
if ((it->second) >= 9) {
block_host(address);
MCLOG_CYAN(el::Level::Info, "global", "Host " << address.host_str() << " added to block list. Failed to connect after at least 9 attempts.");
}
}
return true;
}
Expand Down

0 comments on commit 9f8a0a4

Please sign in to comment.