diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-10-14 18:07:54 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-10-14 18:07:54 -0500 |
commit | dc48cdc998fde44dc744711e6e5920be73f74a36 (patch) | |
tree | 3b8f6085b93e060ad2d75cbc8b8deedff581910e /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #5834 (diff) | |
parent | ban peers sending bad pow outright (diff) | |
download | monero-dc48cdc998fde44dc744711e6e5920be73f74a36.tar.xz |
Merge pull request #5933
3455efa ban peers sending bad pow outright (moneromooo-monero)
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index fef86fd34..6f5f912cd 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -217,13 +217,13 @@ namespace cryptonote return true; } //------------------------------------------------------------------------------------------------------------------------------ - bool core_rpc_server::add_host_fail(const connection_context *ctx) + bool core_rpc_server::add_host_fail(const connection_context *ctx, unsigned int score) { if(!ctx || !ctx->m_remote_address.is_blockable()) return false; CRITICAL_REGION_LOCAL(m_host_fails_score_lock); - uint64_t fails = ++m_host_fails_score[ctx->m_remote_address.host_str()]; + uint64_t fails = m_host_fails_score[ctx->m_remote_address.host_str()] += score; MDEBUG("Host " << ctx->m_remote_address.host_str() << " fail score=" << fails); if(fails > RPC_IP_FAILS_BEFORE_BLOCK) { |