From 81ba2e9671128a18da9589012f8d878ea4c42130 Mon Sep 17 00:00:00 2001 From: Andrey Tvorozhkov Date: Tue, 10 Sep 2024 01:13:49 +0300 Subject: [PATCH] Don't allow empty cache --- lite-server-daemon/adnl-lite-proxy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lite-server-daemon/adnl-lite-proxy.cpp b/lite-server-daemon/adnl-lite-proxy.cpp index 965de9059..572ad3b72 100644 --- a/lite-server-daemon/adnl-lite-proxy.cpp +++ b/lite-server-daemon/adnl-lite-proxy.cpp @@ -889,7 +889,7 @@ namespace ton::liteserver { promise.set_value(result.clone()); } - cache_similar.erase(it); + cache_similar.erase(data_hash); } } @@ -980,7 +980,7 @@ namespace ton::liteserver { auto it = cache_similar.find(data_hash); - if (it != cache_similar.end()) { + if (it != cache_similar.end() && !cache_similar[data_hash].empty()) { LOG(INFO) << "Found similar request, store: " << data_hash; it->second.push_back(std::move(promise)); return;