diff --git a/src/dht.cpp b/src/dht.cpp index 8382ad39..887def08 100644 --- a/src/dht.cpp +++ b/src/dht.cpp @@ -721,7 +721,7 @@ Dht::Search::insertNode(std::shared_ptr node, time_point now, const Blob& return id.xorCmp(nid, sn.node->id) < 0; }); if (!found) { - if (nodes.size()-num_candidates >= SEARCH_NODES) { + if (nodes.size()-num_candidates >= SEARCH_NODES or nodes.size() >= SEARCH_NODES+TARGET_NODES/2) { if (node->isExpired(now)) return false; if (n == nodes.end()) {