aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.h
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2019-06-13 08:47:06 +0100
committerHoward Chu <hyc@symas.com>2019-06-16 11:38:08 +0100
commita182df21d0760e037219a6ae0a31b26b00489f22 (patch)
treebe176e7cfff73cdde8a110abcad57bd51bb21630 /src/rpc/core_rpc_server.h
parentMerge pull request #5641 (diff)
downloadmonero-a182df21d0760e037219a6ae0a31b26b00489f22.tar.xz
Bans for RPC connections
Make bans control RPC sessions too. And auto-ban some bad requests. Drops HTTP connections whenever response code is 500.
Diffstat (limited to 'src/rpc/core_rpc_server.h')
-rw-r--r--src/rpc/core_rpc_server.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.h b/src/rpc/core_rpc_server.h
index e4683bbe2..328e62dfa 100644
--- a/src/rpc/core_rpc_server.h
+++ b/src/rpc/core_rpc_server.h
@@ -236,6 +236,7 @@ namespace cryptonote
private:
bool check_core_busy();
bool check_core_ready();
+ bool add_host_fail(const connection_context *ctx);
//utils
uint64_t get_block_reward(const block& blk);
@@ -254,6 +255,8 @@ private:
bool m_was_bootstrap_ever_used;
network_type m_nettype;
bool m_restricted;
+ epee::critical_section m_host_fails_score_lock;
+ std::map<std::string, uint64_t> m_host_fails_score;
};
}