diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-04-01 17:31:01 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-04-01 17:31:01 +0200 |
commit | 13f414cb9fd8de5db2edb91c9a5dcc3d8e35999e (patch) | |
tree | 32387108d9dea382f8d6e776294a4f6ee78cebb2 | |
parent | Merge pull request #5317 (diff) | |
parent | Fix daemon startup parameter '--limit-rate' processing after parameter defaults (diff) | |
download | monero-13f414cb9fd8de5db2edb91c9a5dcc3d8e35999e.tar.xz |
Merge pull request #5322
85f2f8c9 Fix daemon startup parameter '--limit-rate' processing after parameter defaults (rbrunner7)
-rw-r--r-- | src/p2p/net_node.inl | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index ba6e79d3f..565fcf0ea 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -2236,11 +2236,10 @@ namespace nodetool template<class t_payload_net_handler> bool node_server<t_payload_net_handler>::set_rate_up_limit(const boost::program_options::variables_map& vm, int64_t limit) { - this->islimitup=true; + this->islimitup=(limit != -1) && (limit != default_limit_up); if (limit==-1) { limit=default_limit_up; - this->islimitup=false; } epee::net_utils::connection<epee::levin::async_protocol_handler<p2p_connection_context> >::set_rate_up_limit( limit ); @@ -2251,10 +2250,9 @@ namespace nodetool template<class t_payload_net_handler> bool node_server<t_payload_net_handler>::set_rate_down_limit(const boost::program_options::variables_map& vm, int64_t limit) { - this->islimitdown=true; + this->islimitdown=(limit != -1) && (limit != default_limit_down); if(limit==-1) { limit=default_limit_down; - this->islimitdown=false; } epee::net_utils::connection<epee::levin::async_protocol_handler<p2p_connection_context> >::set_rate_down_limit( limit ); MINFO("Set limit-down to " << limit << " kB/s"); |