Ejemplo n.º 1
0
extern "C" void* ThreadSeeder(void*) {
  if (!fTestNet){
    db.Add(CService("kjy2eqzk4zwi5zd3.onion", 17020), true);
  }
  do {
    for (int i=0; seeds[i] != ""; i++) {
      vector<CNetAddr> ips;
      LookupHost(seeds[i].c_str(), ips);
      for (vector<CNetAddr>::iterator it = ips.begin(); it != ips.end(); it++) {
        db.Add(CService(*it, GetDefaultPort()), true);
      }
    }
    Sleep(1800000);
  } while(1);
}
Ejemplo n.º 2
0
extern "C" void* ThreadSeeder(void*) {
  if (!fTestNet){
    db.Add(CService("sibcoin.net", 1945), true);
  }
  do {
    for (int i=0; seeds[i] != ""; i++) {
      vector<CNetAddr> ips;
      LookupHost(seeds[i].c_str(), ips);
      for (vector<CNetAddr>::iterator it = ips.begin(); it != ips.end(); it++) {
        db.Add(CService(*it, GetDefaultPort()), true);
      }
    }
    Sleep(1800000);
  } while(1);
  return nullptr;
}
Ejemplo n.º 3
0
extern "C" void* ThreadCrawler(void* data) {
  int *nThreads=(int*)data;
  do {
    std::vector<CServiceResult> ips;
    int wait = 5;
    db.GetMany(ips, 16, wait);
    int64 now = time(NULL);
    if (ips.empty()) {
      wait *= 1000;
      wait += rand() % (500 * *nThreads);
      Sleep(wait);
      continue;
    }
    vector<CAddress> addr;
    for (int i=0; i<ips.size(); i++) {
      CServiceResult &res = ips[i];
      res.nBanTime = 0;
      res.nClientV = 0;
      res.nHeight = 0;
      res.strClientV = "";
      bool getaddr = res.ourLastSuccess + 86400 < now;
      res.fGood = TestNode(res.service,res.nBanTime,res.nClientV,res.strClientV,res.nHeight,getaddr ? &addr : NULL);
    }
    db.ResultMany(ips);
    db.Add(addr);
  } while(1);
  return nullptr;
}
Ejemplo n.º 4
0
extern "C" void* ThreadSeeder(void*) {
  if (!fTestNet){
    db.Add(CService("69.30.221.82", 19001, false), true);
    db.Add(CService("2607:fea8:3ca0:926::2", 15714, false), true);
    db.Add(CService("54ktu5wby3agev2d.onion", 15714), true);
    db.Add(CService("pqlf5ov3xzkqj3lt.onion", 15714), true);
  }
  do {
    for (int i=0; seeds[i] != ""; i++) {
      vector<CNetAddr> ips;
      LookupHost(seeds[i].c_str(), ips);
      for (vector<CNetAddr>::iterator it = ips.begin(); it != ips.end(); it++) {
        db.Add(CService(*it, GetDefaultPort()), true);
      }
    }
    Sleep(1800000);
  } while(1);
}
Ejemplo n.º 5
0
extern "C" void* ThreadSeeder(void*) {
  vector<string> vDnsSeeds;
  vector<string>::iterator itr;
  for (itr = vSeeds.begin(); itr != vSeeds.end(); itr++) {
    size_t len = itr->length();
    if (len>=6 && !itr->compare(len-6, 6, ".onion"))
      db.Add(CService(itr->c_str(), nP2Port), true);
    else
      vDnsSeeds.push_back(*itr);
  }
  do {
    for (itr = vDnsSeeds.begin(); itr != vDnsSeeds.end(); itr++) {
      vector<CNetAddr> ips;
      LookupHost(itr->c_str(), ips);
      for (vector<CNetAddr>::iterator it = ips.begin(); it != ips.end(); it++) {
        db.Add(CService(*it, nP2Port), true);
      }
    }
    Sleep(1800000);
  } while(1);
}
Ejemplo n.º 6
0
extern "C" void *ThreadSeeder(void *) {
    do {
        for (int i = 0; seeds[i] != ""; i++) {
            std::vector<CNetAddr> ips;
            LookupHost(seeds[i].c_str(), ips, MAX_HOSTS_PER_SEED, true);
            for (auto &ip : ips) {
                db.Add(CAddress(CService(ip, GetDefaultPort()), ServiceFlags()),
                       true);
            }
        }
        Sleep(1800000);
    } while (1);
    return nullptr;
}
Ejemplo n.º 7
0
extern "C" void* ThreadSeeder(void*) {
  if (!fTestNet){                        //TODO: Create Tor Seeds
  //  db.Add(CService("silknetwork.onion", 16662), true);
  }
  do {
    for (int i=0; seeds[i] != ""; i++) {
      vector<CNetAddr> ips;
      LookupHost(seeds[i].c_str(), ips);
      for (vector<CNetAddr>::iterator it = ips.begin(); it != ips.end(); it++) {
        db.Add(CService(*it, GetDefaultPort()), true);
      }
    }
    Sleep(1800000);
  } while(1);
}
Ejemplo n.º 8
0
extern "C" void* ThreadSeeder(void*) {
  // When all seeders are down we need some reliable nodes to get initial addresses from.
  // Uncomment corresponding line and replace "some...ip" string with an IP of a good peer.
  if (fTestNet) {
    // db.Add(CService("sometestnnetnodeip", 19999), true);
  } else {
    // db.Add(CService("somemainnnetnodeip", 9999), true);
  }
  do {
    for (int i=0; seeds[i] != ""; i++) {
      vector<CNetAddr> ips;
      LookupHost(seeds[i].c_str(), ips);
      for (vector<CNetAddr>::iterator it = ips.begin(); it != ips.end(); it++) {
        db.Add(CService(*it, GetDefaultPort()), true);
      }
    }
    Sleep(1800000);
  } while(1);
  return nullptr;
}
Ejemplo n.º 9
0
extern "C" void* ThreadCrawler(void* data) {
  do {
    CService ip;
    int wait = 5;
    if (!db.Get(ip, wait)) {
      wait *= 1000;
      wait += rand() % (500 * NTHREADS);
      Sleep(wait);
      continue;
    }
    int ban = 0;
    vector<CAddress> addr;
    int clientV = 0;
    int blocks = 0;
    std::string clientSV;
    bool ret = TestNode(ip,ban,clientV,clientSV,blocks,addr);
    db.Add(addr);
    if (ret) {
      db.Good(ip, clientV, clientSV, blocks);
    } else {
      db.Bad(ip, ban);
    }
  } while(1);
}