diff options
| author | Alexander Blair <snipa@jagtech.io> | 2020-02-28 19:36:16 -0800 |
|---|---|---|
| committer | Alexander Blair <snipa@jagtech.io> | 2020-02-28 19:36:16 -0800 |
| commit | 4da37daf67976e48d6fc75f2a5a6f5858d227815 (patch) | |
| tree | ef7cf33b245ddf3e9325639a2dfb49baf6a5d82c /src/daemon/command_parser_executor.cpp | |
| parent | 8d5e043981454e076c22ec28102f25913d36194b (diff) | |
| parent | 5985c5afe8051ef9933212e62293ece3634a5024 (diff) | |
| download | monzero-core-4da37daf67976e48d6fc75f2a5a6f5858d227815.tar.gz monzero-core-4da37daf67976e48d6fc75f2a5a6f5858d227815.tar.xz monzero-core-4da37daf67976e48d6fc75f2a5a6f5858d227815.zip | |
Merge pull request #6211
5985c5af rpc: add bad-blocks to flush_cache RPC (moneromooo-monero)
Diffstat (limited to 'src/daemon/command_parser_executor.cpp')
| -rw-r--r-- | src/daemon/command_parser_executor.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index ed6d3af01..3a4081e39 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -857,13 +857,27 @@ bool t_command_parser_executor::set_bootstrap_daemon(const std::vector<std::stri bool t_command_parser_executor::flush_cache(const std::vector<std::string>& args) { + bool bad_txs = false, bad_blocks = false; + std::string arg; + if (args.empty()) goto show_list; - if (args[0] == "bad-txs") - return m_executor.flush_cache(true); + + for (size_t i = 0; i < args.size(); ++i) + { + arg = args[i]; + if (arg == "bad-txs") + bad_txs = true; + else if (arg == "bad-blocks") + bad_blocks = true; + else + goto show_list; + } + return m_executor.flush_cache(bad_txs, bad_blocks); show_list: - std::cout << "Cache type needed: bad-txs" << std::endl; + std::cout << "Invalid cache type: " << arg << std::endl; + std::cout << "Cache types: bad-txs bad-blocks" << std::endl; return true; } |
