mirror of
https://github.com/monero-project/monero.git
synced 2026-01-12 04:55:44 -08:00
Merge pull request #9740
008ba966d blockchain sync: reduce disk writes from 2 to 1 per tx (jeffro256)
This commit is contained in:
@@ -1063,7 +1063,7 @@ 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;
|
||||
bool bad_blocks = false;
|
||||
std::string arg;
|
||||
|
||||
if (args.empty())
|
||||
@@ -1072,18 +1072,16 @@ bool t_command_parser_executor::flush_cache(const std::vector<std::string>& args
|
||||
for (size_t i = 0; i < args.size(); ++i)
|
||||
{
|
||||
arg = args[i];
|
||||
if (arg == "bad-txs")
|
||||
bad_txs = true;
|
||||
else if (arg == "bad-blocks")
|
||||
if (arg == "bad-blocks")
|
||||
bad_blocks = true;
|
||||
else
|
||||
goto show_list;
|
||||
}
|
||||
return m_executor.flush_cache(bad_txs, bad_blocks);
|
||||
return m_executor.flush_cache(bad_blocks);
|
||||
|
||||
show_list:
|
||||
std::cout << "Invalid cache type: " << arg << std::endl;
|
||||
std::cout << "Cache types: bad-txs bad-blocks" << std::endl;
|
||||
std::cout << "Cache types: bad-blocks" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,9 +119,9 @@ public:
|
||||
|
||||
if (shared)
|
||||
{
|
||||
core.get().get_blockchain_storage().set_txpool_notify(cryptonote::listener::zmq_pub::txpool_add{shared});
|
||||
core.get().get_blockchain_storage().add_block_notify(cryptonote::listener::zmq_pub::chain_main{shared});
|
||||
core.get().get_blockchain_storage().add_miner_notify(cryptonote::listener::zmq_pub::miner_data{shared});
|
||||
core.get().set_txpool_listener(cryptonote::listener::zmq_pub::txpool_add{shared});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2440,14 +2440,13 @@ bool t_rpc_command_executor::set_bootstrap_daemon(
|
||||
return true;
|
||||
}
|
||||
|
||||
bool t_rpc_command_executor::flush_cache(bool bad_txs, bool bad_blocks)
|
||||
bool t_rpc_command_executor::flush_cache(bool bad_blocks)
|
||||
{
|
||||
cryptonote::COMMAND_RPC_FLUSH_CACHE::request req;
|
||||
cryptonote::COMMAND_RPC_FLUSH_CACHE::response res;
|
||||
std::string fail_message = "Unsuccessful";
|
||||
epee::json_rpc::error error_resp;
|
||||
|
||||
req.bad_txs = bad_txs;
|
||||
req.bad_blocks = bad_blocks;
|
||||
|
||||
if (m_is_rpc)
|
||||
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
|
||||
bool rpc_payments();
|
||||
|
||||
bool flush_cache(bool bad_txs, bool invalid_blocks);
|
||||
bool flush_cache(bool invalid_blocks);
|
||||
};
|
||||
|
||||
} // namespace daemonize
|
||||
|
||||
Reference in New Issue
Block a user