diff options
author | naughtyfox <mail.for.milo@gmail.com> | 2019-12-04 15:21:39 +0300 |
---|---|---|
committer | naughtyfox <mail.for.milo@gmail.com> | 2019-12-04 17:45:27 +0300 |
commit | a2578892c06c570d9a45a136898dbd89bba9d37c (patch) | |
tree | ea4bcd6d43002fa94e094e8c935f3ff9b7a687a3 /src/rpc/core_rpc_server.cpp | |
parent | ANONYMITY_NETWORKS.md : fix unintentional wrapping (diff) | |
download | monero-a2578892c06c570d9a45a136898dbd89bba9d37c.tar.xz |
--disable-ban-rpc option to prevent RPC users from banning
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 9117b5b3a..c892f1048 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -152,6 +152,7 @@ namespace cryptonote : m_core(cr) , m_p2p(p2p) , m_was_bootstrap_ever_used(false) + , disable_rpc_ban(false) {} //------------------------------------------------------------------------------------------------------------------------------ bool core_rpc_server::set_bootstrap_daemon(const std::string &address, const std::string &username_password) @@ -241,6 +242,7 @@ namespace cryptonote if (!rpc_config) return false; + disable_rpc_ban = rpc_config->disable_rpc_ban; std::string address = command_line::get_arg(vm, arg_rpc_payment_address); if (!address.empty()) { @@ -353,7 +355,7 @@ namespace cryptonote //------------------------------------------------------------------------------------------------------------------------------ bool core_rpc_server::add_host_fail(const connection_context *ctx, unsigned int score) { - if(!ctx || !ctx->m_remote_address.is_blockable()) + if(!ctx || !ctx->m_remote_address.is_blockable() || disable_rpc_ban) return false; CRITICAL_REGION_LOCAL(m_host_fails_score_lock); |