mirror of
https://github.com/monero-project/monero.git
synced 2025-12-16 08:03:58 -05:00
Allow the number of incoming connections to be limited
It was already possible to limit outgoing connections. One might want to do this on home network connections with high bandwidth but low usage caps.
This commit is contained in:
parent
d609a2c164
commit
32c0f908cd
13 changed files with 205 additions and 40 deletions
|
|
@ -428,6 +428,23 @@ bool t_command_parser_executor::out_peers(const std::vector<std::string>& args)
|
|||
return m_executor.out_peers(limit);
|
||||
}
|
||||
|
||||
bool t_command_parser_executor::in_peers(const std::vector<std::string>& args)
|
||||
{
|
||||
if (args.empty()) return false;
|
||||
|
||||
unsigned int limit;
|
||||
try {
|
||||
limit = std::stoi(args[0]);
|
||||
}
|
||||
|
||||
catch(const std::exception& ex) {
|
||||
_erro("stoi exception");
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue