aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/network_throttle.hpp
diff options
context:
space:
mode:
authorrbrunner7 <rbrunner@dreamshare.ch>2017-11-26 15:26:17 +0100
committerrbrunner7 <rbrunner@dreamshare.ch>2017-11-28 21:18:01 +0100
commitcf5f62361682877a08b246a0d04827c5c4cc30f5 (patch)
treec7feb58c06bf0f3ed0396baa93ea0e95c032887b /src/p2p/network_throttle.hpp
parentMerge pull request #2827 (diff)
downloadmonero-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 '')
-rw-r--r--src/p2p/network_throttle.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/p2p/network_throttle.hpp b/src/p2p/network_throttle.hpp
index 9853df5e1..bf1f93859 100644
--- a/src/p2p/network_throttle.hpp
+++ b/src/p2p/network_throttle.hpp
@@ -80,7 +80,8 @@ namespace net_utils
{
// just typedefs to in code define the units used. TODO later it will be enforced that casts to other numericals are only explicit to avoid mistakes? use boost::chrono?
-typedef double network_speed_kbps;
+typedef double network_speed_kbps; // externally, for parameters and return values, all defined in kilobytes per second
+typedef double network_speed_bps; // throttle-internally, bytes per second
typedef double network_time_seconds;
typedef double network_MB;
@@ -137,7 +138,6 @@ class i_network_throttle {
public:
virtual void set_name(const std::string &name)=0;
virtual void set_target_speed( network_speed_kbps target )=0;
- virtual void set_real_target_speed(network_speed_kbps real_target)=0;
virtual network_speed_kbps get_target_speed()=0;
virtual void handle_trafic_exact(size_t packet_size) =0; // count the new traffic/packet; the size is exact considering all network costs