diff options
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 20 | ||||
-rw-r--r-- | src/daemon/command_server.cpp | 2 | ||||
-rw-r--r-- | src/daemon/main.cpp | 2 | ||||
-rw-r--r-- | src/daemon/rpc_command_executor.cpp | 9 | ||||
-rw-r--r-- | src/daemon/rpc_command_executor.h | 2 |
5 files changed, 25 insertions, 10 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; } diff --git a/src/daemon/command_server.cpp b/src/daemon/command_server.cpp index 8ec690631..7fae77c30 100644 --- a/src/daemon/command_server.cpp +++ b/src/daemon/command_server.cpp @@ -325,7 +325,7 @@ t_command_server::t_command_server( m_command_lookup.set_handler( "flush_cache" , std::bind(&t_command_parser_executor::flush_cache, &m_parser, p::_1) - , "flush_cache bad-txs" + , "flush_cache [bad-txs] [bad-blocks]" , "Flush the specified cache(s)." ); } diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index 8fa983fe5..3e25636d8 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -69,7 +69,7 @@ uint16_t parse_public_rpc_port(const po::variables_map &vm) const auto &restricted_rpc_port = cryptonote::core_rpc_server::arg_rpc_restricted_bind_port; if (!command_line::is_arg_defaulted(vm, restricted_rpc_port)) { - rpc_port_str = command_line::get_arg(vm, restricted_rpc_port);; + rpc_port_str = command_line::get_arg(vm, restricted_rpc_port); } else if (command_line::get_arg(vm, cryptonote::core_rpc_server::arg_restricted_rpc)) { diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index f2c7244a3..80b14d534 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -1909,9 +1909,9 @@ bool t_rpc_command_executor::print_coinbase_tx_sum(uint64_t height, uint64_t cou tools::msg_writer() << "Sum of coinbase transactions between block heights [" << height << ", " << (height + count) << ") is " - << cryptonote::print_money(res.emission_amount + res.fee_amount) << " " - << "consisting of " << cryptonote::print_money(res.emission_amount) - << " in emissions, and " << cryptonote::print_money(res.fee_amount) << " in fees"; + << cryptonote::print_money(boost::multiprecision::uint128_t(res.wide_emission_amount) + boost::multiprecision::uint128_t(res.wide_fee_amount)) << " " + << "consisting of " << cryptonote::print_money(boost::multiprecision::uint128_t(res.wide_emission_amount)) + << " in emissions, and " << cryptonote::print_money(boost::multiprecision::uint128_t(res.wide_fee_amount)) << " in fees"; return true; } @@ -2431,7 +2431,7 @@ bool t_rpc_command_executor::set_bootstrap_daemon( return true; } -bool t_rpc_command_executor::flush_cache(bool bad_txs) +bool t_rpc_command_executor::flush_cache(bool bad_txs, bool bad_blocks) { cryptonote::COMMAND_RPC_FLUSH_CACHE::request req; cryptonote::COMMAND_RPC_FLUSH_CACHE::response res; @@ -2439,6 +2439,7 @@ bool t_rpc_command_executor::flush_cache(bool bad_txs) epee::json_rpc::error error_resp; req.bad_txs = bad_txs; + req.bad_blocks = bad_blocks; if (m_is_rpc) { diff --git a/src/daemon/rpc_command_executor.h b/src/daemon/rpc_command_executor.h index 1754ce32e..66ada6f1f 100644 --- a/src/daemon/rpc_command_executor.h +++ b/src/daemon/rpc_command_executor.h @@ -172,7 +172,7 @@ public: bool rpc_payments(); - bool flush_cache(bool bad_txs); + bool flush_cache(bool bad_txs, bool invalid_blocks); }; } // namespace daemonize |