aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-10-04 11:41:41 +0200
committerRiccardo Spagni <ric@spagni.net>2016-10-04 11:41:41 +0200
commite34ef4de6c99de3d057901feabe4d38e1fde4a39 (patch)
tree444079a995edddb208419f902d0d124463d3071e /src
parentMerge pull request #1168 (diff)
parentRemoved all code related to fast_exit (diff)
downloadmonero-e34ef4de6c99de3d057901feabe4d38e1fde4a39.tar.xz
Merge pull request #1171
6390673 Removed all code related to fast_exit (NanoAkron)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp17
-rw-r--r--src/cryptonote_core/cryptonote_core.h20
-rw-r--r--src/daemon/command_parser_executor.cpp6
-rw-r--r--src/daemon/command_parser_executor.h2
-rw-r--r--src/daemon/command_server.cpp5
-rw-r--r--src/daemon/rpc_command_executor.cpp28
-rw-r--r--src/daemon/rpc_command_executor.h2
-rw-r--r--src/rpc/core_rpc_server.cpp8
-rw-r--r--src/rpc/core_rpc_server.h2
9 files changed, 1 insertions, 89 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 5ea4d9fbc..bd8a6a493 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -434,24 +434,11 @@ namespace cryptonote
{
m_miner.stop();
m_mempool.deinit();
- if (!m_fast_exit)
- {
- m_blockchain_storage.deinit();
- }
+ m_blockchain_storage.deinit();
unlock_db_directory();
return true;
}
//-----------------------------------------------------------------------------------------------
- void core::set_fast_exit()
- {
- m_fast_exit = true;
- }
- //-----------------------------------------------------------------------------------------------
- bool core::get_fast_exit()
- {
- return m_fast_exit;
- }
- //-----------------------------------------------------------------------------------------------
void core::test_drop_download()
{
m_test_drop_download = false;
@@ -986,6 +973,4 @@ namespace cryptonote
{
raise(SIGTERM);
}
-
- std::atomic<bool> core::m_fast_exit(false);
}
diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h
index 97abf3271..6727d6b04 100644
--- a/src/cryptonote_core/cryptonote_core.h
+++ b/src/cryptonote_core/cryptonote_core.h
@@ -230,29 +230,11 @@ namespace cryptonote
*
* Uninitializes the miner instance, transaction pool, and Blockchain
*
- * if m_fast_exit is set, the call to Blockchain::deinit() is not made.
- *
* @return true
*/
bool deinit();
/**
- * @brief sets fast exit flag
- *
- * @note see deinit()
- */
- static void set_fast_exit();
-
- /**
- * @brief gets the current state of the fast exit flag
- *
- * @return the fast exit flag
- *
- * @note see deinit()
- */
- static bool get_fast_exit();
-
- /**
* @brief sets to drop blocks downloaded (for testing)
*/
void test_drop_download();
@@ -764,8 +746,6 @@ namespace cryptonote
*/
bool unlock_db_directory();
- static std::atomic<bool> m_fast_exit; //!< whether or not to deinit Blockchain on exit
-
bool m_test_drop_download = true; //!< whether or not to drop incoming blocks (for testing)
uint64_t m_test_drop_download_height = 0; //!< height under which to drop incoming blocks, if doing so
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp
index 83892c661..6ea862b56 100644
--- a/src/daemon/command_parser_executor.cpp
+++ b/src/daemon/command_parser_executor.cpp
@@ -336,12 +336,6 @@ bool t_command_parser_executor::set_limit_down(const std::vector<std::string>& a
return m_executor.set_limit_down(limit);
}
-bool t_command_parser_executor::fast_exit(const std::vector<std::string>& args)
-{
- if (!args.empty()) return false;
- return m_executor.fast_exit();
-}
-
bool t_command_parser_executor::out_peers(const std::vector<std::string>& args)
{
if (args.empty()) return false;
diff --git a/src/daemon/command_parser_executor.h b/src/daemon/command_parser_executor.h
index e59f51cdb..7819bd261 100644
--- a/src/daemon/command_parser_executor.h
+++ b/src/daemon/command_parser_executor.h
@@ -98,8 +98,6 @@ public:
bool set_limit_down(const std::vector<std::string>& args);
- bool fast_exit(const std::vector<std::string>& args);
-
bool out_peers(const std::vector<std::string>& args);
bool start_save_graph(const std::vector<std::string>& args);
diff --git a/src/daemon/command_server.cpp b/src/daemon/command_server.cpp
index 2c3c54841..cb54d1966 100644
--- a/src/daemon/command_server.cpp
+++ b/src/daemon/command_server.cpp
@@ -171,11 +171,6 @@ t_command_server::t_command_server(
, "limit <kB/s> - Set download limit"
);
m_command_lookup.set_handler(
- "fast_exit"
- , std::bind(&t_command_parser_executor::fast_exit, &m_parser, p::_1)
- , "Exit"
- );
- m_command_lookup.set_handler(
"out_peers"
, std::bind(&t_command_parser_executor::out_peers, &m_parser, p::_1)
, "Set max number of out peers"
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 85d8c0c4d..2289bf37d 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -989,34 +989,6 @@ bool t_rpc_command_executor::set_limit_down(int limit)
return true;
}
-bool t_rpc_command_executor::fast_exit()
-{
- cryptonote::COMMAND_RPC_FAST_EXIT::request req;
- cryptonote::COMMAND_RPC_FAST_EXIT::response res;
-
- std::string fail_message = "Daemon did not stop";
-
- if (m_is_rpc)
- {
- if (!m_rpc_client->rpc_request(req, res, "/fast_exit", fail_message.c_str()))
- {
- return true;
- }
- }
-
- else
- {
- if (!m_rpc_server->on_fast_exit(req, res) || res.status != CORE_RPC_STATUS_OK)
- {
- tools::fail_msg_writer() << fail_message.c_str();
- return true;
- }
- }
-
- tools::success_msg_writer() << "Daemon stopped";
- return true;
-}
-
bool t_rpc_command_executor::out_peers(uint64_t limit)
{
cryptonote::COMMAND_RPC_OUT_PEERS::request req;
diff --git a/src/daemon/rpc_command_executor.h b/src/daemon/rpc_command_executor.h
index afb2b5f36..5eed44353 100644
--- a/src/daemon/rpc_command_executor.h
+++ b/src/daemon/rpc_command_executor.h
@@ -116,8 +116,6 @@ public:
bool set_limit_down(int limit);
- bool fast_exit();
-
bool out_peers(uint64_t limit);
bool start_save_graph();
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 4047417fd..27c1dfddb 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -1215,14 +1215,6 @@ namespace cryptonote
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
- bool core_rpc_server::on_fast_exit(const COMMAND_RPC_FAST_EXIT::request& req, COMMAND_RPC_FAST_EXIT::response& res)
- {
- cryptonote::core::set_fast_exit();
- m_p2p.deinit();
- m_core.deinit();
- return true;
- }
- //------------------------------------------------------------------------------------------------------------------------------
bool core_rpc_server::on_out_peers(const COMMAND_RPC_OUT_PEERS::request& req, COMMAND_RPC_OUT_PEERS::response& res)
{
// TODO
diff --git a/src/rpc/core_rpc_server.h b/src/rpc/core_rpc_server.h
index da1cb0d6e..a4ca8bf1b 100644
--- a/src/rpc/core_rpc_server.h
+++ b/src/rpc/core_rpc_server.h
@@ -94,7 +94,6 @@ namespace cryptonote
MAP_URI_AUTO_JON2("/get_transaction_pool", on_get_transaction_pool, COMMAND_RPC_GET_TRANSACTION_POOL)
MAP_URI_AUTO_JON2_IF("/stop_daemon", on_stop_daemon, COMMAND_RPC_STOP_DAEMON, !m_restricted)
MAP_URI_AUTO_JON2("/getinfo", on_get_info, COMMAND_RPC_GET_INFO)
- MAP_URI_AUTO_JON2_IF("/fast_exit", on_fast_exit, COMMAND_RPC_FAST_EXIT, !m_restricted)
MAP_URI_AUTO_JON2_IF("/out_peers", on_out_peers, COMMAND_RPC_OUT_PEERS, !m_restricted)
MAP_URI_AUTO_JON2_IF("/start_save_graph", on_start_save_graph, COMMAND_RPC_START_SAVE_GRAPH, !m_restricted)
MAP_URI_AUTO_JON2_IF("/stop_save_graph", on_stop_save_graph, COMMAND_RPC_STOP_SAVE_GRAPH, !m_restricted)
@@ -138,7 +137,6 @@ namespace cryptonote
bool on_set_log_level(const COMMAND_RPC_SET_LOG_LEVEL::request& req, COMMAND_RPC_SET_LOG_LEVEL::response& res);
bool on_get_transaction_pool(const COMMAND_RPC_GET_TRANSACTION_POOL::request& req, COMMAND_RPC_GET_TRANSACTION_POOL::response& res);
bool on_stop_daemon(const COMMAND_RPC_STOP_DAEMON::request& req, COMMAND_RPC_STOP_DAEMON::response& res);
- bool on_fast_exit(const COMMAND_RPC_FAST_EXIT::request& req, COMMAND_RPC_FAST_EXIT::response& res);
bool on_out_peers(const COMMAND_RPC_OUT_PEERS::request& req, COMMAND_RPC_OUT_PEERS::response& res);
bool on_start_save_graph(const COMMAND_RPC_START_SAVE_GRAPH::request& req, COMMAND_RPC_START_SAVE_GRAPH::response& res);
bool on_stop_save_graph(const COMMAND_RPC_STOP_SAVE_GRAPH::request& req, COMMAND_RPC_STOP_SAVE_GRAPH::response& res);