Merge pull request #5530

6abaaaa remove obsolete save_graph skeleton code (moneromooo-monero)
This commit is contained in:
luigi1111 2019-07-24 14:07:29 -05:00
commit e579fe4ae0
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
14 changed files with 0 additions and 168 deletions

View file

@ -186,8 +186,6 @@ class connection_basic { // not-templated base class for rapid developmet of som
void sleep_before_packet(size_t packet_size, int phase, int q_len); // execute a sleep ; phase is not really used now(?) void sleep_before_packet(size_t packet_size, int phase, int q_len); // execute a sleep ; phase is not really used now(?)
static void save_limit_to_file(int limit); ///< for dr-monero static void save_limit_to_file(int limit); ///< for dr-monero
static double get_sleep_time(size_t cb); static double get_sleep_time(size_t cb);
static void set_save_graph(bool save_graph);
}; };
} // nameserver } // nameserver

View file

@ -284,9 +284,6 @@ double connection_basic::get_sleep_time(size_t cb) {
return t; return t;
} }
void connection_basic::set_save_graph(bool save_graph) {
}
} // namespace } // namespace
} // namespace } // namespace

View file

@ -27,10 +27,8 @@ save
set_log set_log
show_hr show_hr
start_mining start_mining
start_save_graph
status status
stop_daemon stop_daemon
stop_mining stop_mining
stop_save_graph
sync_info sync_info
unban unban

View file

@ -526,18 +526,6 @@ bool t_command_parser_executor::in_peers(const std::vector<std::string>& args)
return m_executor.in_peers(limit); return m_executor.in_peers(limit);
} }
bool t_command_parser_executor::start_save_graph(const std::vector<std::string>& args)
{
if (!args.empty()) return false;
return m_executor.start_save_graph();
}
bool t_command_parser_executor::stop_save_graph(const std::vector<std::string>& args)
{
if (!args.empty()) return false;
return m_executor.stop_save_graph();
}
bool t_command_parser_executor::hard_fork_info(const std::vector<std::string>& args) bool t_command_parser_executor::hard_fork_info(const std::vector<std::string>& args)
{ {
int version; int version;

View file

@ -115,10 +115,6 @@ public:
bool in_peers(const std::vector<std::string>& args); bool in_peers(const std::vector<std::string>& args);
bool start_save_graph(const std::vector<std::string>& args);
bool stop_save_graph(const std::vector<std::string>& args);
bool hard_fork_info(const std::vector<std::string>& args); bool hard_fork_info(const std::vector<std::string>& args);
bool show_bans(const std::vector<std::string>& args); bool show_bans(const std::vector<std::string>& args);

View file

@ -214,16 +214,6 @@ t_command_server::t_command_server(
, "in_peers <max_number>" , "in_peers <max_number>"
, "Set the <max_number> of in peers." , "Set the <max_number> of in peers."
); );
m_command_lookup.set_handler(
"start_save_graph"
, std::bind(&t_command_parser_executor::start_save_graph, &m_parser, p::_1)
, "Start saving data for dr monero."
);
m_command_lookup.set_handler(
"stop_save_graph"
, std::bind(&t_command_parser_executor::stop_save_graph, &m_parser, p::_1)
, "Stop saving data for dr monero."
);
m_command_lookup.set_handler( m_command_lookup.set_handler(
"hard_fork_info" "hard_fork_info"
, std::bind(&t_command_parser_executor::hard_fork_info, &m_parser, p::_1) , std::bind(&t_command_parser_executor::hard_fork_info, &m_parser, p::_1)

View file

@ -1530,59 +1530,6 @@ bool t_rpc_command_executor::in_peers(uint64_t limit)
return true; return true;
} }
bool t_rpc_command_executor::start_save_graph()
{
cryptonote::COMMAND_RPC_START_SAVE_GRAPH::request req;
cryptonote::COMMAND_RPC_START_SAVE_GRAPH::response res;
std::string fail_message = "Unsuccessful";
if (m_is_rpc)
{
if (!m_rpc_client->rpc_request(req, res, "/start_save_graph", fail_message.c_str()))
{
return true;
}
}
else
{
if (!m_rpc_server->on_start_save_graph(req, res) || res.status != CORE_RPC_STATUS_OK)
{
tools::fail_msg_writer() << make_error(fail_message, res.status);
return true;
}
}
tools::success_msg_writer() << "Saving graph is now on";
return true;
}
bool t_rpc_command_executor::stop_save_graph()
{
cryptonote::COMMAND_RPC_STOP_SAVE_GRAPH::request req;
cryptonote::COMMAND_RPC_STOP_SAVE_GRAPH::response res;
std::string fail_message = "Unsuccessful";
if (m_is_rpc)
{
if (!m_rpc_client->rpc_request(req, res, "/stop_save_graph", fail_message.c_str()))
{
return true;
}
}
else
{
if (!m_rpc_server->on_stop_save_graph(req, res) || res.status != CORE_RPC_STATUS_OK)
{
tools::fail_msg_writer() << make_error(fail_message, res.status);
return true;
}
}
tools::success_msg_writer() << "Saving graph is now off";
return true;
}
bool t_rpc_command_executor::hard_fork_info(uint8_t version) bool t_rpc_command_executor::hard_fork_info(uint8_t version)
{ {
cryptonote::COMMAND_RPC_HARD_FORK_INFO::request req; cryptonote::COMMAND_RPC_HARD_FORK_INFO::request req;

View file

@ -129,10 +129,6 @@ public:
bool in_peers(uint64_t limit); bool in_peers(uint64_t limit);
bool start_save_graph();
bool stop_save_graph();
bool hard_fork_info(uint8_t version); bool hard_fork_info(uint8_t version);
bool print_bans(); bool print_bans();

View file

@ -143,8 +143,6 @@ namespace nodetool
const command_line::arg_descriptor<int64_t> arg_limit_rate_down = {"limit-rate-down", "set limit-rate-down [kB/s]", P2P_DEFAULT_LIMIT_RATE_DOWN}; const command_line::arg_descriptor<int64_t> arg_limit_rate_down = {"limit-rate-down", "set limit-rate-down [kB/s]", P2P_DEFAULT_LIMIT_RATE_DOWN};
const command_line::arg_descriptor<int64_t> arg_limit_rate = {"limit-rate", "set limit-rate [kB/s]", -1}; const command_line::arg_descriptor<int64_t> arg_limit_rate = {"limit-rate", "set limit-rate [kB/s]", -1};
const command_line::arg_descriptor<bool> arg_save_graph = {"save-graph", "Save data for dr monero", false};
boost::optional<std::vector<proxy>> get_proxies(boost::program_options::variables_map const& vm) boost::optional<std::vector<proxy>> get_proxies(boost::program_options::variables_map const& vm)
{ {
namespace ip = boost::asio::ip; namespace ip = boost::asio::ip;

View file

@ -216,7 +216,6 @@ namespace nodetool
m_hide_my_port(false), m_hide_my_port(false),
m_no_igd(false), m_no_igd(false),
m_offline(false), m_offline(false),
m_save_graph(false),
is_closing(false), is_closing(false),
m_network_id() m_network_id()
{} {}
@ -400,12 +399,6 @@ namespace nodetool
public: public:
void set_save_graph(bool save_graph)
{
m_save_graph = save_graph;
epee::net_utils::connection_basic::set_save_graph(save_graph);
}
void set_rpc_port(uint16_t rpc_port) void set_rpc_port(uint16_t rpc_port)
{ {
m_rpc_port = rpc_port; m_rpc_port = rpc_port;
@ -423,7 +416,6 @@ namespace nodetool
bool m_hide_my_port; bool m_hide_my_port;
bool m_no_igd; bool m_no_igd;
bool m_offline; bool m_offline;
std::atomic<bool> m_save_graph;
std::atomic<bool> is_closing; std::atomic<bool> is_closing;
std::unique_ptr<boost::thread> mPeersLoggerThread; std::unique_ptr<boost::thread> mPeersLoggerThread;
//critical_section m_connections_lock; //critical_section m_connections_lock;
@ -505,8 +497,6 @@ namespace nodetool
extern const command_line::arg_descriptor<int64_t> arg_limit_rate_up; extern const command_line::arg_descriptor<int64_t> arg_limit_rate_up;
extern const command_line::arg_descriptor<int64_t> arg_limit_rate_down; extern const command_line::arg_descriptor<int64_t> arg_limit_rate_down;
extern const command_line::arg_descriptor<int64_t> arg_limit_rate; extern const command_line::arg_descriptor<int64_t> arg_limit_rate;
extern const command_line::arg_descriptor<bool> arg_save_graph;
} }
POP_WARNINGS POP_WARNINGS

View file

@ -111,7 +111,6 @@ namespace nodetool
command_line::add_arg(desc, arg_limit_rate_up); command_line::add_arg(desc, arg_limit_rate_up);
command_line::add_arg(desc, arg_limit_rate_down); command_line::add_arg(desc, arg_limit_rate_down);
command_line::add_arg(desc, arg_limit_rate); command_line::add_arg(desc, arg_limit_rate);
command_line::add_arg(desc, arg_save_graph);
} }
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
template<class t_payload_net_handler> template<class t_payload_net_handler>
@ -380,11 +379,6 @@ namespace nodetool
} }
} }
if(command_line::has_arg(vm, arg_save_graph))
{
set_save_graph(true);
}
if (command_line::has_arg(vm,arg_p2p_add_exclusive_node)) if (command_line::has_arg(vm,arg_p2p_add_exclusive_node))
{ {
if (!parse_peers_and_add_to_container(vm, arg_p2p_add_exclusive_node, m_exclusive_peers)) if (!parse_peers_and_add_to_container(vm, arg_p2p_add_exclusive_node, m_exclusive_peers))

View file

@ -2108,22 +2108,6 @@ namespace cryptonote
return true; return true;
} }
//------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------------
bool core_rpc_server::on_start_save_graph(const COMMAND_RPC_START_SAVE_GRAPH::request& req, COMMAND_RPC_START_SAVE_GRAPH::response& res, const connection_context *ctx)
{
PERF_TIMER(on_start_save_graph);
m_p2p.set_save_graph(true);
res.status = CORE_RPC_STATUS_OK;
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
bool core_rpc_server::on_stop_save_graph(const COMMAND_RPC_STOP_SAVE_GRAPH::request& req, COMMAND_RPC_STOP_SAVE_GRAPH::response& res, const connection_context *ctx)
{
PERF_TIMER(on_stop_save_graph);
m_p2p.set_save_graph(false);
res.status = CORE_RPC_STATUS_OK;
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
bool core_rpc_server::on_update(const COMMAND_RPC_UPDATE::request& req, COMMAND_RPC_UPDATE::response& res, const connection_context *ctx) bool core_rpc_server::on_update(const COMMAND_RPC_UPDATE::request& req, COMMAND_RPC_UPDATE::response& res, const connection_context *ctx)
{ {
PERF_TIMER(on_update); PERF_TIMER(on_update);

View file

@ -123,8 +123,6 @@ namespace cryptonote
MAP_URI_AUTO_JON2_IF("/set_limit", on_set_limit, COMMAND_RPC_SET_LIMIT, !m_restricted) MAP_URI_AUTO_JON2_IF("/set_limit", on_set_limit, COMMAND_RPC_SET_LIMIT, !m_restricted)
MAP_URI_AUTO_JON2_IF("/out_peers", on_out_peers, COMMAND_RPC_OUT_PEERS, !m_restricted) MAP_URI_AUTO_JON2_IF("/out_peers", on_out_peers, COMMAND_RPC_OUT_PEERS, !m_restricted)
MAP_URI_AUTO_JON2_IF("/in_peers", on_in_peers, COMMAND_RPC_IN_PEERS, !m_restricted) MAP_URI_AUTO_JON2_IF("/in_peers", on_in_peers, COMMAND_RPC_IN_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)
MAP_URI_AUTO_JON2("/get_outs", on_get_outs, COMMAND_RPC_GET_OUTPUTS) MAP_URI_AUTO_JON2("/get_outs", on_get_outs, COMMAND_RPC_GET_OUTPUTS)
MAP_URI_AUTO_JON2_IF("/update", on_update, COMMAND_RPC_UPDATE, !m_restricted) MAP_URI_AUTO_JON2_IF("/update", on_update, COMMAND_RPC_UPDATE, !m_restricted)
MAP_URI_AUTO_BIN2("/get_output_distribution.bin", on_get_output_distribution_bin, COMMAND_RPC_GET_OUTPUT_DISTRIBUTION) MAP_URI_AUTO_BIN2("/get_output_distribution.bin", on_get_output_distribution_bin, COMMAND_RPC_GET_OUTPUT_DISTRIBUTION)
@ -199,8 +197,6 @@ namespace cryptonote
bool on_set_limit(const COMMAND_RPC_SET_LIMIT::request& req, COMMAND_RPC_SET_LIMIT::response& res, const connection_context *ctx = NULL); bool on_set_limit(const COMMAND_RPC_SET_LIMIT::request& req, COMMAND_RPC_SET_LIMIT::response& res, const connection_context *ctx = NULL);
bool on_out_peers(const COMMAND_RPC_OUT_PEERS::request& req, COMMAND_RPC_OUT_PEERS::response& res, const connection_context *ctx = NULL); bool on_out_peers(const COMMAND_RPC_OUT_PEERS::request& req, COMMAND_RPC_OUT_PEERS::response& res, const connection_context *ctx = NULL);
bool on_in_peers(const COMMAND_RPC_IN_PEERS::request& req, COMMAND_RPC_IN_PEERS::response& res, const connection_context *ctx = NULL); bool on_in_peers(const COMMAND_RPC_IN_PEERS::request& req, COMMAND_RPC_IN_PEERS::response& res, const connection_context *ctx = NULL);
bool on_start_save_graph(const COMMAND_RPC_START_SAVE_GRAPH::request& req, COMMAND_RPC_START_SAVE_GRAPH::response& res, const connection_context *ctx = NULL);
bool on_stop_save_graph(const COMMAND_RPC_STOP_SAVE_GRAPH::request& req, COMMAND_RPC_STOP_SAVE_GRAPH::response& res, const connection_context *ctx = NULL);
bool on_update(const COMMAND_RPC_UPDATE::request& req, COMMAND_RPC_UPDATE::response& res, const connection_context *ctx = NULL); bool on_update(const COMMAND_RPC_UPDATE::request& req, COMMAND_RPC_UPDATE::response& res, const connection_context *ctx = NULL);
bool on_get_output_distribution_bin(const COMMAND_RPC_GET_OUTPUT_DISTRIBUTION::request& req, COMMAND_RPC_GET_OUTPUT_DISTRIBUTION::response& res, const connection_context *ctx = NULL); bool on_get_output_distribution_bin(const COMMAND_RPC_GET_OUTPUT_DISTRIBUTION::request& req, COMMAND_RPC_GET_OUTPUT_DISTRIBUTION::response& res, const connection_context *ctx = NULL);
bool on_pop_blocks(const COMMAND_RPC_POP_BLOCKS::request& req, COMMAND_RPC_POP_BLOCKS::response& res, const connection_context *ctx = NULL); bool on_pop_blocks(const COMMAND_RPC_POP_BLOCKS::request& req, COMMAND_RPC_POP_BLOCKS::response& res, const connection_context *ctx = NULL);

View file

@ -1722,46 +1722,6 @@ namespace cryptonote
typedef epee::misc_utils::struct_init<response_t> response; typedef epee::misc_utils::struct_init<response_t> response;
}; };
struct COMMAND_RPC_START_SAVE_GRAPH
{
struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
struct response_t
{
std::string status;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_STOP_SAVE_GRAPH
{
struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
struct response_t
{
std::string status;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_HARD_FORK_INFO struct COMMAND_RPC_HARD_FORK_INFO
{ {
struct request_t struct request_t