dht: make sure search can be flagged "done"

This commit is contained in:
Simon Désaulniers authored and Adrien Béraud committed 2016-09-08 12:24:35 -04:00
1 parent babfed73f3
commit ec587f9b58
1 file changed
+3 -3
+3 -3
View File
@@ -1182,9 +1182,6 @@ void Dht::searchSendAnnounceValue(const std::shared_ptr<Search>& sr) {
++ait;
}
}
if (sr->callbacks.empty() && sr->announce.empty() && sr->listeners.empty())
sr->done = true;
}
};
DHT_LOG.WARN("[search %s IPv%c] [node %s] sending %s",
@@ -1290,6 +1287,9 @@ Dht::searchStep(std::shared_ptr<Search> sr)
// Announce requests
searchSendAnnounceValue(sr);
if (sr->callbacks.empty() && sr->announce.empty() && sr->listeners.empty())
sr->done = true;
}
if (sr->currentlySolicitedNodeCount() < MAX_REQUESTED_SEARCH_NODES) {