aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-10-22 15:28:08 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-10-25 18:41:54 +0000
commita4dc575ccba8348886ed19594a16f5a7242f8fe6 (patch)
treee6afd9cd4b734b336e74af84931aa45a87f9e3eb /src/rpc/core_rpc_server.cpp
parentMerge pull request #5357 (diff)
downloadmonero-a4dc575ccba8348886ed19594a16f5a7242f8fe6.tar.xz
rpc: add a flush_cache RPC
This allows flushing internal caches (for now, the bad tx cache, which will allow debugging a stuck monerod after it has failed to verify a transaction in a block, since it would otherwise not try again, making subsequent log changes pointless)
Diffstat (limited to '')
-rw-r--r--src/rpc/core_rpc_server.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 8882df5d7..5a6a395bc 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -2995,10 +2995,18 @@ namespace cryptonote
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
+ bool core_rpc_server::on_flush_cache(const COMMAND_RPC_FLUSH_CACHE::request& req, COMMAND_RPC_FLUSH_CACHE::response& res, epee::json_rpc::error& error_resp, const connection_context *ctx)
+ {
+ RPC_TRACKER(flush_cache);
+ if (req.bad_txs)
+ m_core.flush_bad_txs_cache();
+ res.status = CORE_RPC_STATUS_OK;
+ return true;
+ }
+ //------------------------------------------------------------------------------------------------------------------------------
bool core_rpc_server::on_rpc_access_submit_nonce(const COMMAND_RPC_ACCESS_SUBMIT_NONCE::request& req, COMMAND_RPC_ACCESS_SUBMIT_NONCE::response& res, epee::json_rpc::error& error_resp, const connection_context *ctx)
{
RPC_TRACKER(rpc_access_submit_nonce);
-
bool r;
if (use_bootstrap_daemon_if_necessary<COMMAND_RPC_ACCESS_SUBMIT_NONCE>(invoke_http_mode::JON, "rpc_access_submit_nonce", req, res, r))
return r;