From 60e6f91541eff8eb2eaa953128d215226444b7a2 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Tue, 9 Jul 2024 11:04:19 +0200 Subject: [PATCH] cleanup old workaround code --- solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp b/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp index 9ab220d..8cf000f 100644 --- a/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp +++ b/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp @@ -398,8 +398,6 @@ float SHA1_NGCFT1::iterate(float delta) { // ran regardless of _max_concurrent_in { // new chunk picker code - // HACK: work around missing contact events - std::vector c_offline_to_remove; std::vector cp_to_remove; // first, update timers @@ -414,14 +412,14 @@ float SHA1_NGCFT1::iterate(float delta) { // now check for potentially missing cp auto cput_view = _cr.view(); - cput_view.each([this, &c_offline_to_remove](const Contact3 cv) { + cput_view.each([this, &cp_to_remove](const Contact3 cv) { Contact3Handle c{_cr, cv}; //std::cout << "cput :)\n"; if (!c.any_of()) { std::cout << "cput uh nuh :(\n"; - c_offline_to_remove.push_back(c); + cp_to_remove.push_back(c); return; } @@ -433,12 +431,11 @@ float SHA1_NGCFT1::iterate(float delta) { }); // now update all cp that are tagged - _cr.view().each([this, &_peer_open_requests, &cp_to_remove, &c_offline_to_remove](const Contact3 cv, ChunkPicker& cp) { + _cr.view().each([this, &_peer_open_requests, &cp_to_remove](const Contact3 cv, ChunkPicker& cp) { Contact3Handle c{_cr, cv}; if (!c.all_of()) { - //cp_to_remove.push_back(c); - c_offline_to_remove.push_back(c); + cp_to_remove.push_back(c); return; } @@ -501,17 +498,6 @@ float SHA1_NGCFT1::iterate(float delta) { for (const auto& c : cp_to_remove) { c.remove(); } - for (const auto& c : c_offline_to_remove) { - c.remove(); - - for (const auto& [_, o] : _info_to_content) { - removeParticipation(c, o); - - if (o.all_of()) { - o.get().others.erase(c); - } - } - } } if (_peer_open_requests.empty()) {