dht: wait for connection before running searches

This commit is contained in:
Adrien Béraud committed 2016-05-27 15:39:48 -04:00
1 parent d44c59016e
commit bd08506146
1 file changed
+2
+2
View File
@@ -722,6 +722,8 @@ void
Dht::searchStep(std::shared_ptr<Search> sr)
{
if (not sr or sr->expired or sr->done) return;
if (sr->nodes.empty() and (sr->af == AF_INET ? buckets : buckets6).isEmpty())
return; // wait for connection
const auto& now = scheduler.time();
DHT_LOG.DEBUG("[search %s IPv%c] step (%d requests)", sr->id.toString().c_str(), sr->af == AF_INET ? '4' : '6', sr->currentGetRequests());