mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-29 22:33:28 +01:00
remove obsolete save_graph skeleton code
This commit is contained in:
parent
c0bc6d96cd
commit
6abaaaa994
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -525,18 +525,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;
|
||||||
|
@ -113,10 +113,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);
|
||||||
|
@ -213,16 +213,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)
|
||||||
|
@ -1529,59 +1529,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;
|
||||||
|
@ -127,10 +127,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();
|
||||||
|
@ -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;
|
||||||
|
@ -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()
|
||||||
{}
|
{}
|
||||||
@ -396,12 +395,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;
|
||||||
@ -419,7 +412,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;
|
||||||
@ -500,8 +492,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
|
||||||
|
@ -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>
|
||||||
@ -292,11 +291,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))
|
||||||
|
@ -2088,22 +2088,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);
|
||||||
|
@ -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)
|
||||||
@ -198,8 +196,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);
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user