mirror of
https://github.com/monero-project/monero.git
synced 2025-06-17 00:59:18 -04:00
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:
parent
2dc1cd9ae6
commit
d8ee0a95c7
5 changed files with 60 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue