print limits when running limit commands with no arguments

It's more user friendly that an error message saying the command
does not exist.
This commit is contained in:
moneromooo-monero 2015-05-17 13:13:02 +01:00
parent 2dc1cd9ae6
commit d8ee0a95c7
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
5 changed files with 60 additions and 3 deletions

View file

@ -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