diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-09-24 13:08:25 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-09-25 16:00:43 +0000 |
commit | 3455efafa812d646f2eea42db14b761f34975147 (patch) | |
tree | dffe8ec81dc709f86bbb004017aca3dfa77efa30 /src/p2p/net_node.inl | |
parent | Merge pull request #5928 (diff) | |
download | monero-3455efafa812d646f2eea42db14b761f34975147.tar.xz |
ban peers sending bad pow outright
PoW is expensive to verify, so be strict
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r-- | src/p2p/net_node.inl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 24c87cef8..e8e19905a 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) { |