diff --git a/solanaceae/ngc_ft1_sha1/chunk_picker.cpp b/solanaceae/ngc_ft1_sha1/chunk_picker.cpp index 644eaf8..1cc5865 100644 --- a/solanaceae/ngc_ft1_sha1/chunk_picker.cpp +++ b/solanaceae/ngc_ft1_sha1/chunk_picker.cpp @@ -73,8 +73,8 @@ std::vector ChunkPicker::updateChunkRequests( assert(objreg.valid(participating_in_last)); auto it = participating_unfinished.find(participating_in_last); - // hard limit robin rounds to array size time 100 - for (size_t i = 0; req_ret.size() < num_requests && i < participating_unfinished.size()*100; i++) { + // hard limit robin rounds to array size time 20 + for (size_t i = 0; req_ret.size() < num_requests && i < participating_unfinished.size()*20; i++) { if (it == participating_unfinished.end()) { it = participating_unfinished.begin(); } @@ -172,6 +172,12 @@ std::vector ChunkPicker::updateChunkRequests( } } + if (it == participating_unfinished.end()) { + participating_in_last = entt::null; + } else { + participating_in_last = it->first; + } + if (req_ret.size() < num_requests) { std::cerr << "CP: could not fulfil, " << group_number << ":" << peer_number << " only has " << req_ret.size() << " candidates\n"; }