From fcfcc3ac8687a6619d08854a0062ee7d036645fb Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 28 May 2019 17:54:41 +0000 Subject: rpc: in/out peers can now return the setting's value --- src/daemon/command_parser_executor.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src/daemon/command_parser_executor.cpp') diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index 17b945c9a..71b0818e4 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -493,11 +493,14 @@ bool t_command_parser_executor::set_limit_down(const std::vector& a bool t_command_parser_executor::out_peers(const std::vector& 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& 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& 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& 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& args) -- cgit v1.2.3