Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/main.cpp
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | |||||
CAddrDb db; | CAddrDb db; | ||||
extern "C" void *ThreadCrawler(void *data) { | extern "C" void *ThreadCrawler(void *data) { | ||||
int *nThreads = (int *)data; | int *nThreads = (int *)data; | ||||
do { | do { | ||||
std::vector<CServiceResult> ips; | std::vector<CServiceResult> ips; | ||||
int wait = 5; | int wait = 5; | ||||
db.GetMany(ips, 16, wait); | db.GetMany(ips, 16, wait); | ||||
int64 now = time(nullptr); | int64_t now = time(nullptr); | ||||
if (ips.empty()) { | if (ips.empty()) { | ||||
wait *= 1000; | wait *= 1000; | ||||
wait += rand() % (500 * *nThreads); | wait += rand() % (500 * *nThreads); | ||||
Sleep(wait); | Sleep(wait); | ||||
continue; | continue; | ||||
} | } | ||||
std::vector<CAddress> addr; | std::vector<CAddress> addr; | ||||
for (int i = 0; i < ips.size(); i++) { | for (int i = 0; i < ips.size(); i++) { | ||||
▲ Show 20 Lines • Show All 374 Lines • Show Last 20 Lines |