diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-10-22 15:28:08 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-10-25 18:41:54 +0000 |
commit | a4dc575ccba8348886ed19594a16f5a7242f8fe6 (patch) | |
tree | e6afd9cd4b734b336e74af84931aa45a87f9e3eb /src/daemon/command_parser_executor.cpp | |
parent | Merge pull request #5357 (diff) | |
download | monero-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 'src/daemon/command_parser_executor.cpp')
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index 8e78f3bd1..b827221f6 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -844,4 +844,16 @@ bool t_command_parser_executor::set_bootstrap_daemon(const std::vector<std::stri args_count > 2 ? args[2] : std::string()); } +bool t_command_parser_executor::flush_cache(const std::vector<std::string>& args) +{ + if (args.empty()) + goto show_list; + if (args[0] == "bad-txs") + return m_executor.flush_cache(true); + +show_list: + std::cout << "Cache type needed: bad-txs" << std::endl; + return true; +} + } // namespace daemonize |