Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sipa/bitcoin-seeder
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Crypto-lyon/insacoin-seeder
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 7 commits
  • 7 files changed
  • 1 contributor

Commits on Nov 6, 2018

  1. bitcoin -> insacoin

    darosior authored Nov 6, 2018
    Copy the full SHA
    5d6ccb4 View commit details
  2. bitcoin -> insacoin

    darosior authored Nov 6, 2018
    Copy the full SHA
    2a93b76 View commit details
  3. Update db.h

    darosior authored Nov 6, 2018
    Copy the full SHA
    6f8ef05 View commit details
  4. bitcoin -> insacoin

    darosior authored Nov 6, 2018
    Copy the full SHA
    28da09f View commit details
  5. insacoin magic bytes

    darosior authored Nov 6, 2018
    Copy the full SHA
    f81250b View commit details
  6. insacoin port

    darosior authored Nov 6, 2018
    Copy the full SHA
    c179731 View commit details
  7. 64 bits arch

    darosior authored Nov 6, 2018
    Copy the full SHA
    6e04c1f View commit details
Showing with 20 additions and 22 deletions.
  1. +1 −1 Makefile
  2. +2 −2 README
  3. +2 −2 bitcoin.cpp
  4. +3 −3 db.h
  5. +10 −12 main.cpp
  6. +1 −1 protocol.cpp
  7. +1 −1 protocol.h
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CXXFLAGS = -O3 -g0 -march=native
CXXFLAGS = -O3 -g0
LDFLAGS = $(CXXFLAGS)

dnsseed: dns.o bitcoin.o netbase.o protocol.o db.o main.o util.o
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bitcoin-seeder
insacoin-seeder
==============

Bitcoin-seeder is a crawler for the Bitcoin network, which exposes a list
Insacoin-seeder is a crawler for the Insacoin network, which exposes a list
of reliable nodes via a built-in DNS server.

Features:
4 changes: 2 additions & 2 deletions bitcoin.cpp
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ class CNode {
CAddress me(CService("0.0.0.0"));
BeginMessage("version");
int nBestHeight = GetRequireHeight();
string ver = "/bitcoin-seeder:0.01/";
string ver = "/insacoin-seeder:0.01/";
vSend << PROTOCOL_VERSION << nLocalServices << nTime << you << me << nLocalNonce << ver << nBestHeight;
EndMessage();
}
@@ -298,7 +298,7 @@ bool TestNode(const CService &cip, int &ban, int &clientV, std::string &clientSV

/*
int main(void) {
CService ip("bitcoin.sipa.be", 8333, true);
CService ip("chaingeit.net", 7333, true);
vector<CAddress> vAddr;
vAddr.clear();
int ban = 0;
6 changes: 3 additions & 3 deletions db.h
Original file line number Diff line number Diff line change
@@ -12,11 +12,11 @@

#define MIN_RETRY 1000

#define REQUIRE_VERSION 70001
#define REQUIRE_VERSION 70002

static inline int GetRequireHeight(const bool testnet = fTestNet)
{
return testnet ? 500000 : 350000;
return testnet ? 0 : 470000;
}

std::string static inline ToString(const CService &ip) {
@@ -119,7 +119,7 @@ class CAddrInfo {
}
int GetBanTime() const {
if (IsGood()) return 0;
if (clientVersion && clientVersion < 31900) { return 604800; }
if (clientVersion && clientVersion < 50000) { return 604800; }
if (stat1M.reliability - stat1M.weight + 1.0 < 0.15 && stat1M.count > 32) { return 30*86400; }
if (stat1W.reliability - stat1W.weight + 1.0 < 0.10 && stat1W.count > 16) { return 7*86400; }
if (stat1D.reliability - stat1D.weight + 1.0 < 0.05 && stat1D.count > 8) { return 1*86400; }
22 changes: 10 additions & 12 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ class CDnsSeedOpts {
CDnsSeedOpts() : nThreads(96), nDnsThreads(4), nPort(53), mbox(NULL), ns(NULL), host(NULL), tor(NULL), fUseTestNet(false), fWipeBan(false), fWipeIgnore(false), ipv4_proxy(NULL), ipv6_proxy(NULL) {}

void ParseCommandLine(int argc, char **argv) {
static const char *help = "Bitcoin-seeder\n"
static const char *help = "Insacoin-seeder\n"
"Usage: %s -h <host> -n <ns> [-m <mbox>] [-t <threads>] [-p <port>]\n"
"\n"
"Options:\n"
@@ -397,17 +397,14 @@ extern "C" void* ThreadStats(void*) {
return nullptr;
}

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.alexykot.me",
"testnet-seed.bitcoin.petertodd.org",
"testnet-seed.bluematt.me",
"testnet-seed.bitcoin.schildbach.de",
""};
static const string mainnet_seeds[] = {"dnsseed.chaingeit.net", ""};
static const string testnet_seeds[] = {"testnet-seed.chaingeit.net"
""}; // No testnet seed for the moment on insacoin
static const string *seeds = mainnet_seeds;

extern "C" void* ThreadSeeder(void*) {
if (!fTestNet){
db.Add(CService("kjy2eqzk4zwi5zd3.onion", 8333), true);
db.Add(CService("kjy2eqzk4zwi5zd3.onion", 7333), true);
}
do {
for (int i=0; seeds[i] != ""; i++) {
@@ -459,10 +456,11 @@ int main(int argc, char **argv) {
bool fDNS = true;
if (opts.fUseTestNet) {
printf("Using testnet.\n");
pchMessageStart[0] = 0x0b;
pchMessageStart[1] = 0x11;
pchMessageStart[2] = 0x09;
pchMessageStart[3] = 0x07;
// Magic bytes for testnet are just +1 from mainnet
pchMessageStart[0] = 0xfd;
pchMessageStart[1] = 0xc2;
pchMessageStart[2] = 0xb8;
pchMessageStart[3] = 0xdd;
seeds = testnet_seeds;
fTestNet = true;
}
2 changes: 1 addition & 1 deletion protocol.cpp
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ static const char* ppszTypeName[] =
"block",
};

unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
unsigned char pchMessageStart[4] = { 0xfd, 0xc2, 0xb8, 0xdd };

CMessageHeader::CMessageHeader()
{
2 changes: 1 addition & 1 deletion protocol.h
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
extern bool fTestNet;
static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
{
return testnet ? 18333 : 8333;
return testnet ? 17333 : 7333;
}

//