mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
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:
6 files changed
+37
-67
No files matched your search
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user