rpc: in/out peers can now return the setting's value

This commit is contained in:
moneromooo-monero 2019-05-28 17:54:41 +00:00
parent 5fbfa8a656
commit fcfcc3ac86
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
7 changed files with 63 additions and 21 deletions

View file

@ -493,11 +493,14 @@ bool t_command_parser_executor::set_limit_down(const std::vector<std::string>& a
bool t_command_parser_executor::out_peers(const std::vector<std::string>& args)
{
if (args.empty()) return false;
unsigned int limit;
bool set = false;
uint32_t limit = 0;
try {
limit = std::stoi(args[0]);
if (!args.empty())
{
limit = std::stoi(args[0]);
set = true;
}
}
catch(const std::exception& ex) {
@ -505,16 +508,19 @@ bool t_command_parser_executor::out_peers(const std::vector<std::string>& args)
return false;
}
return m_executor.out_peers(limit);
return m_executor.out_peers(set, limit);
}
bool t_command_parser_executor::in_peers(const std::vector<std::string>& args)
{
if (args.empty()) return false;
unsigned int limit;
bool set = false;
uint32_t limit = 0;
try {
limit = std::stoi(args[0]);
if (!args.empty())
{
limit = std::stoi(args[0]);
set = true;
}
}
catch(const std::exception& ex) {
@ -522,7 +528,7 @@ bool t_command_parser_executor::in_peers(const std::vector<std::string>& args)
return false;
}
return m_executor.in_peers(limit);
return m_executor.in_peers(set, limit);
}
bool t_command_parser_executor::start_save_graph(const std::vector<std::string>& args)