diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-07-24 14:18:09 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-07-24 14:18:09 -0500 |
commit | e241a6280da0785d40e7cda1c474206d711534a0 (patch) | |
tree | a73ac8f314cb0e4f562faad823cf992c0de552e3 /src/daemon/command_parser_executor.cpp | |
parent | Merge pull request #5576 (diff) | |
parent | rpc: in/out peers can now return the setting's value (diff) | |
download | monero-e241a6280da0785d40e7cda1c474206d711534a0.tar.xz |
Merge pull request #5582
fcfcc3a rpc: in/out peers can now return the setting's value (moneromooo-monero)
Diffstat (limited to 'src/daemon/command_parser_executor.cpp')
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index e3da12252..778d7b4d8 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -494,11 +494,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) { @@ -506,16 +509,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) { @@ -523,7 +529,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::hard_fork_info(const std::vector<std::string>& args) |