mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 21:03:28 +01:00
Merge pull request #5530
6abaaaa
remove obsolete save_graph skeleton code (moneromooo-monero)
This commit is contained in:
commit
e579fe4ae0
@ -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(?)
|
||||
static void save_limit_to_file(int limit); ///< for dr-monero
|
||||
static double get_sleep_time(size_t cb);
|
||||
|
||||
static void set_save_graph(bool save_graph);
|
||||
};
|
||||
|
||||
} // nameserver
|
||||
|
@ -284,9 +284,6 @@ double connection_basic::get_sleep_time(size_t cb) {
|
||||
return t;
|
||||
}
|
||||
|
||||
void connection_basic::set_save_graph(bool save_graph) {
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
@ -27,10 +27,8 @@ save
|
||||
set_log
|
||||
show_hr
|
||||
start_mining
|
||||
start_save_graph
|
||||
status
|
||||
stop_daemon
|
||||
stop_mining
|
||||
stop_save_graph
|
||||
sync_info
|
||||
unban
|
||||
|
@ -526,18 +526,6 @@ bool t_command_parser_executor::in_peers(const std::vector<std::string>& args)
|
||||
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)
|
||||
{
|
||||
int version;
|
||||
|
@ -115,10 +115,6 @@ public:
|
||||
|
||||
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 show_bans(const std::vector<std::string>& args);
|
||||
|
@ -214,16 +214,6 @@ t_command_server::t_command_server(
|
||||
, "in_peers <max_number>"
|
||||
, "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(
|
||||
"hard_fork_info"
|
||||
, std::bind(&t_command_parser_executor::hard_fork_info, &m_parser, p::_1)
|
||||
|
@ -1530,59 +1530,6 @@ bool t_rpc_command_executor::in_peers(uint64_t limit)
|
||||
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)
|
||||
{
|
||||
cryptonote::COMMAND_RPC_HARD_FORK_INFO::request req;
|
||||
|
@ -129,10 +129,6 @@ public:
|
||||
|
||||
bool in_peers(uint64_t limit);
|
||||
|
||||
bool start_save_graph();
|
||||
|
||||
bool stop_save_graph();
|
||||
|
||||
bool hard_fork_info(uint8_t version);
|
||||
|
||||
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 = {"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)
|
||||
{
|
||||
namespace ip = boost::asio::ip;
|
||||
|
@ -216,7 +216,6 @@ namespace nodetool
|
||||
m_hide_my_port(false),
|
||||
m_no_igd(false),
|
||||
m_offline(false),
|
||||
m_save_graph(false),
|
||||
is_closing(false),
|
||||
m_network_id()
|
||||
{}
|
||||
@ -400,12 +399,6 @@ namespace nodetool
|
||||
|
||||
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)
|
||||
{
|
||||
m_rpc_port = rpc_port;
|
||||
@ -423,7 +416,6 @@ namespace nodetool
|
||||
bool m_hide_my_port;
|
||||
bool m_no_igd;
|
||||
bool m_offline;
|
||||
std::atomic<bool> m_save_graph;
|
||||
std::atomic<bool> is_closing;
|
||||
std::unique_ptr<boost::thread> mPeersLoggerThread;
|
||||
//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_down;
|
||||
extern const command_line::arg_descriptor<int64_t> arg_limit_rate;
|
||||
|
||||
extern const command_line::arg_descriptor<bool> arg_save_graph;
|
||||
}
|
||||
|
||||
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_down);
|
||||
command_line::add_arg(desc, arg_limit_rate);
|
||||
command_line::add_arg(desc, arg_save_graph);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------
|
||||
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 (!parse_peers_and_add_to_container(vm, arg_p2p_add_exclusive_node, m_exclusive_peers))
|
||||
|
@ -2108,22 +2108,6 @@ namespace cryptonote
|
||||
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)
|
||||
{
|
||||
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("/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("/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_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)
|
||||
@ -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_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_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_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);
|
||||
|
@ -1722,46 +1722,6 @@ namespace cryptonote
|
||||
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 request_t
|
||||
|
Loading…
Reference in New Issue
Block a user