diff options
author | Alexander Blair <snipa@jagtech.io> | 2020-02-28 19:43:06 -0800 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2020-02-28 19:43:06 -0800 |
commit | e22655a1877037cbf6c6668d038437b3ebec1cb4 (patch) | |
tree | ff0c99833b31f9cdcab1aa00f80be39af2e55858 /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #6213 (diff) | |
parent | --disable-ban-rpc option to prevent RPC users from banning (diff) | |
download | monero-e22655a1877037cbf6c6668d038437b3ebec1cb4.tar.xz |
Merge pull request #6215
a2578892 --disable-ban-rpc option to prevent RPC users from banning (naughtyfox)
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 386ef66dc..e3415c65f 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -157,6 +157,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) @@ -247,6 +248,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() && allow_rpc_payment) { @@ -359,7 +361,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); |