mirror of
https://github.com/monero-project/monero.git
synced 2025-12-25 20:34:36 -08:00
Restore daemon interactive mode
Daemon interactive mode is now working again. RPC mapped calls in daemon and wallet have both had connection_context removed as an argument as that argument was not being used anywhere.
This commit is contained in:
@@ -37,10 +37,18 @@ namespace p = std::placeholders;
|
||||
t_command_server::t_command_server(
|
||||
uint32_t ip
|
||||
, uint16_t port
|
||||
, bool is_rpc
|
||||
, cryptonote::core_rpc_server* rpc_server
|
||||
)
|
||||
: m_parser(ip, port)
|
||||
: m_parser(ip, port, is_rpc, rpc_server)
|
||||
, m_command_lookup()
|
||||
, m_is_rpc(is_rpc)
|
||||
{
|
||||
m_command_lookup.set_handler(
|
||||
"q"
|
||||
, [] (const std::vector<std::string>& args) {return true;}
|
||||
, "ignored"
|
||||
);
|
||||
m_command_lookup.set_handler(
|
||||
"help"
|
||||
, std::bind(&t_command_server::help, this, p::_1)
|
||||
@@ -126,6 +134,11 @@ t_command_server::t_command_server(
|
||||
, std::bind(&t_command_parser_executor::stop_daemon, &m_parser, p::_1)
|
||||
, "Stop the daemon"
|
||||
);
|
||||
m_command_lookup.set_handler(
|
||||
"exit"
|
||||
, std::bind(&t_command_parser_executor::stop_daemon, &m_parser, p::_1)
|
||||
, "Stop the daemon"
|
||||
);
|
||||
m_command_lookup.set_handler(
|
||||
"print_status"
|
||||
, std::bind(&t_command_parser_executor::print_status, &m_parser, p::_1)
|
||||
@@ -163,6 +176,22 @@ bool t_command_server::process_command_vec(const std::vector<std::string>& cmd)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool t_command_server::start_handling()
|
||||
{
|
||||
if (m_is_rpc) return false;
|
||||
|
||||
m_command_lookup.start_handling("", get_commands_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void t_command_server::stop_handling()
|
||||
{
|
||||
if (m_is_rpc) return;
|
||||
|
||||
m_command_lookup.stop_handling();
|
||||
}
|
||||
|
||||
bool t_command_server::help(const std::vector<std::string>& args)
|
||||
{
|
||||
std::cout << get_commands_str() << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user