diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-05-17 13:13:02 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-05-17 13:15:09 +0100 |
commit | d8ee0a95c7e3a1aba2aa79173f2d55f2db6f31cd (patch) | |
tree | 0c7eb5229f6a362066df52f1655249360352f922 /src/p2p/connection_basic.cpp | |
parent | Merge pull request #286 (diff) | |
download | monero-d8ee0a95c7e3a1aba2aa79173f2d55f2db6f31cd.tar.xz |
print limits when running limit commands with no arguments
It's more user friendly that an error message saying the command
does not exist.
Diffstat (limited to 'src/p2p/connection_basic.cpp')
-rw-r--r-- | src/p2p/connection_basic.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/p2p/connection_basic.cpp b/src/p2p/connection_basic.cpp index 0454f30e3..adf159dc0 100644 --- a/src/p2p/connection_basic.cpp +++ b/src/p2p/connection_basic.cpp @@ -199,6 +199,23 @@ void connection_basic::set_rate_down_limit(uint64_t limit) { save_limit_to_file(limit); } +uint64_t connection_basic::get_rate_up_limit() { + uint64_t limit; + { + CRITICAL_REGION_LOCAL( network_throttle_manager::m_lock_get_global_throttle_out ); + limit = network_throttle_manager::get_global_throttle_out().get_terget_speed(); + } + return limit; +} + +uint64_t connection_basic::get_rate_down_limit() { + uint64_t limit; + { + CRITICAL_REGION_LOCAL( network_throttle_manager::m_lock_get_global_throttle_in ); + limit = network_throttle_manager::get_global_throttle_in().get_terget_speed(); + } + return limit; +} void connection_basic::save_limit_to_file(int limit) { // saving limit to file |