mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
dht: limit total node number per search
This commit is contained in:
1 parent
cf3fa7b954
commit
a2eed7e7af
1 file changed
+1
-1
+1
-1
@@ -721,7 +721,7 @@ Dht::Search::insertNode(std::shared_ptr<Node> 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()) {
|
||||
|
||||
Reference in new issue
Block a user