aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_node.inl
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-10-14 18:07:54 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-10-14 18:07:54 -0500
commitdc48cdc998fde44dc744711e6e5920be73f74a36 (patch)
tree3b8f6085b93e060ad2d75cbc8b8deedff581910e /src/p2p/net_node.inl
parentMerge pull request #5834 (diff)
parentban peers sending bad pow outright (diff)
downloadmonero-dc48cdc998fde44dc744711e6e5920be73f74a36.tar.xz
Merge pull request #5933
3455efa ban peers sending bad pow outright (moneromooo-monero)
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r--src/p2p/net_node.inl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index bb77ea658..191efd297 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -315,13 +315,13 @@ namespace nodetool
}
//-----------------------------------------------------------------------------------
template<class t_payload_net_handler>
- bool node_server<t_payload_net_handler>::add_host_fail(const epee::net_utils::network_address &address)
+ bool node_server<t_payload_net_handler>::add_host_fail(const epee::net_utils::network_address &address, unsigned int score)
{
if(!address.is_blockable())
return false;
CRITICAL_REGION_LOCAL(m_host_fails_score_lock);
- uint64_t fails = ++m_host_fails_score[address.host_str()];
+ uint64_t fails = m_host_fails_score[address.host_str()] += score;
MDEBUG("Host " << address.host_str() << " fail score=" << fails);
if(fails > P2P_IP_FAILS_BEFORE_BLOCK)
{