Browse Source

now twister-seeder

pull/1/head
Miguel Freitas 11 years ago
parent
commit
ae6b9278ca
  1. 3
      db.h
  2. 12
      main.cpp
  3. 2
      protocol.cpp
  4. 2
      protocol.h

3
db.h

@ -16,7 +16,8 @@ @@ -16,7 +16,8 @@
static inline int GetRequireHeight(const bool testnet = fTestNet)
{
return testnet ? 0 : 230000;
// return testnet ? 0 : 230000;
return 0;
}
std::string static inline ToString(const CService &ip) {

12
main.cpp

@ -339,13 +339,15 @@ extern "C" void* ThreadStats(void*) { @@ -339,13 +339,15 @@ extern "C" void* ThreadStats(void*) {
} while(1);
}
static const string mainnet_seeds[] = {"dnsseed.bluematt.me", "bitseed.xf2.org", "dnsseed.bitcoin.dashjr.org", "seed.bitcoin.sipa.be", ""};
static const string testnet_seeds[] = {"testnet-seed.bitcoin.petertodd.org", "static-testnet-seed.bitcoin.petertodd.org", ""};
static const string mainnet_seeds[] = {""};
static const string testnet_seeds[] = {""};
static const string *seeds = mainnet_seeds;
extern "C" void* ThreadSeeder(void*) {
extern "C" void* ThreadSeeder(void *arg) {
CDnsSeedOpts *opts = (CDnsSeedOpts *)arg;
if (!fTestNet){
db.Add(CService("kjy2eqzk4zwi5zd3.onion", 8333), true);
db.Add(CService(opts->ns, 28333, true), true);
}
do {
for (int i=0; seeds[i] != ""; i++) {
@ -413,7 +415,7 @@ int main(int argc, char **argv) { @@ -413,7 +415,7 @@ int main(int argc, char **argv) {
printf("done\n");
}
printf("Starting seeder...");
pthread_create(&threadSeed, NULL, ThreadSeeder, NULL);
pthread_create(&threadSeed, NULL, ThreadSeeder, &opts);
printf("done\n");
printf("Starting %i crawler threads...", opts.nThreads);
pthread_attr_t attr_crawler;

2
protocol.cpp

@ -22,7 +22,7 @@ static const char* ppszTypeName[] = @@ -22,7 +22,7 @@ static const char* ppszTypeName[] =
"block",
};
unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
unsigned char pchMessageStart[4] = { 0xf0, 0xda, 0xbb, 0xd2 };
CMessageHeader::CMessageHeader()
{

2
protocol.h

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
extern bool fTestNet;
static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
{
return testnet ? 18333 : 8333;
return testnet ? 18333 : 28333;
}
//

Loading…
Cancel
Save