mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Improve DHT store/load, pinging overlay peers (#840)
* Improve DHT store/load, pinging overlay peers * Fix speed limits in storage * Use keyStoreTypeDirectory in rldp-http-proxy and storage-daemon Mainly for caching synced block in tonlib. --------- Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
c8918f0c02
commit
550c28d7db
16 changed files with 162 additions and 89 deletions
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
|
||||
#include "SpeedLimiter.h"
|
||||
#include "common/errorcode.h"
|
||||
|
||||
namespace ton {
|
||||
|
||||
|
|
@ -41,11 +42,11 @@ void SpeedLimiter::enqueue(double size, td::Timestamp timeout, td::Promise<td::U
|
|||
return;
|
||||
}
|
||||
if (max_speed_ == 0.0) {
|
||||
promise.set_error(td::Status::Error("Speed limit is 0"));
|
||||
promise.set_error(td::Status::Error(ErrorCode::timeout, "Speed limit is 0"));
|
||||
return;
|
||||
}
|
||||
if (timeout < unlock_at_) {
|
||||
promise.set_error(td::Status::Error("Timeout caused by speed limit"));
|
||||
promise.set_error(td::Status::Error(ErrorCode::timeout, "Timeout caused by speed limit"));
|
||||
return;
|
||||
}
|
||||
if (queue_.empty() && unlock_at_.is_in_past()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue