mirror of
https://github.com/monero-project/monero.git
synced 2026-01-10 20:23:44 -08:00
--disable-ban-rpc option to prevent RPC users from banning
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user