diff options
author | rbrunner7 <rbrunner@dreamshare.ch> | 2017-11-26 15:26:17 +0100 |
---|---|---|
committer | rbrunner7 <rbrunner@dreamshare.ch> | 2017-11-28 21:18:01 +0100 |
commit | cf5f62361682877a08b246a0d04827c5c4cc30f5 (patch) | |
tree | c7feb58c06bf0f3ed0396baa93ea0e95c032887b /src/p2p/network_throttle-detail.cpp | |
parent | Merge pull request #2827 (diff) | |
download | monero-cf5f62361682877a08b246a0d04827c5c4cc30f5.tar.xz |
Corrections in rate limiting / trottle code, especially in 'out' direction
Deleted 3 out of 4 calls to method connection_basic::sleep_before_packet
that were erroneous / superfluous, which enabled the elimination of a
"fudge" factor of 2.1 in connection_basic::set_rate_up_limit;
also ended the multiplying of limit values and numbers of bytes
transferred by 1024 before handing them over to the global throttle
objects
Diffstat (limited to 'src/p2p/network_throttle-detail.cpp')
-rw-r--r-- | src/p2p/network_throttle-detail.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/p2p/network_throttle-detail.cpp b/src/p2p/network_throttle-detail.cpp index 1df48ee26..651e01e6b 100644 --- a/src/p2p/network_throttle-detail.cpp +++ b/src/p2p/network_throttle-detail.cpp @@ -160,17 +160,11 @@ void network_throttle::set_target_speed( network_speed_kbps target ) { m_target_speed = target * 1024; MINFO("Setting LIMIT: " << target << " kbps"); - set_real_target_speed(target); -} - -void network_throttle::set_real_target_speed( network_speed_kbps real_target ) -{ - m_real_target_speed = real_target * 1024; } network_speed_kbps network_throttle::get_target_speed() { - return m_real_target_speed / 1024; + return m_target_speed / 1024; } void network_throttle::tick() |