dht: unify bootstrapSearch and refill method

Since bootstrapSearch was rewritten to use the node cache, it made it clear that
refill should be rewritten as such. However, then bootstrapSearch becomes
irrelevant.

An enhancement to refill is that it will let insertNode review its whole list
of nodes and then let it insert nodes up to SEARCH_NODES nodes. The previous
method would not garantee this behavior since, most of the times, it would pass
less than SEARCH_NODES nodes to insertNode.
This commit is contained in:
Simon Désaulniers committed 2016-08-06 21:14:17 -04:00
1 parent a1eaf2e83c
commit c04ede4909
6 files changed
+37 -67

No files matched your search

-5
View File
@@ -275,11 +275,6 @@ NetworkEngine::isNodeBlacklisted(const sockaddr *sa, socklen_t salen) const
return false;
}
std::vector<std::shared_ptr<Node>>
NetworkEngine::getCachedNodes(const InfoHash& id, sa_family_t sa_f) {
return cache.getCachedNodes(id, sa_f, MAX_CACHE_NODE);
}
void
NetworkEngine::processMessage(const uint8_t *buf, size_t buflen, const sockaddr* from, socklen_t fromlen)
{