mirror of
https://github.com/monero-project/monero.git
synced 2026-01-13 13:27:34 -08:00
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)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user