aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
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/rpc/core_rpc_server.cpp
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/rpc/core_rpc_server.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index e9a6a18aa..bcd1d4fc9 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -1547,7 +1547,7 @@ namespace cryptonote
res.status = CORE_RPC_ERROR_CODE_WRONG_PARAM;
return false;
}
- epee::net_utils::connection_basic::set_rate_down_limit(nodetool::default_limit_down * 1024);
+ epee::net_utils::connection_basic::set_rate_down_limit(nodetool::default_limit_down);
}
if (req.limit_up > 0)
@@ -1561,7 +1561,7 @@ namespace cryptonote
res.status = CORE_RPC_ERROR_CODE_WRONG_PARAM;
return false;
}
- epee::net_utils::connection_basic::set_rate_up_limit(nodetool::default_limit_up * 1024);
+ epee::net_utils::connection_basic::set_rate_up_limit(nodetool::default_limit_up);
}
res.limit_down = epee::net_utils::connection_basic::get_rate_down_limit();