Skip to content

Commit 7b99597

Browse files
committed
Changes for Darkcoin
1 parent 8d12fd6 commit 7b99597

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

README

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
litecoin-seeder
1+
darkcoin-seeder
22
===============
33

4-
Litecoin-seeder is a crawler for the Litecoin network, which exposes a list
4+
Darkcoin-seeder is a crawler for the Darkcoin network, which exposes a list
55
of reliable nodes via a built-in DNS server.
66

77
Features:
88
* regularly revisits known nodes to check their availability
99
* bans nodes after enough failures, or bad behaviour
10-
* accepts nodes down to v0.5.0 to request new IP addresses from,
11-
but only reports good post-v0.6.9 nodes.
10+
* accepts nodes down to v0.9.11.5 to request new IP addresses from,
11+
but only reports good post-v0.9.11.5 nodes.
1212
* keeps statistics over (exponential) windows of 2 hours, 8 hours,
1313
1 day and 1 week, to base decisions on.
1414
* very low memory (a few tens of megabytes) and cpu requirements.

bitcoin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class CNode {
8080
CAddress me(CService("0.0.0.0"));
8181
BeginMessage("version");
8282
int nBestHeight = GetRequireHeight();
83-
string ver = "/litecoin-seeder:0.01/";
83+
string ver = "/darkcoin-seeder:0.1.2/";
8484
vSend << PROTOCOL_VERSION << nLocalServices << nTime << you << me << nLocalNonce << ver << nBestHeight;
8585
EndMessage();
8686
}
@@ -296,7 +296,7 @@ bool TestNode(const CService &cip, int &ban, int &clientV, std::string &clientSV
296296

297297
/*
298298
int main(void) {
299-
CService ip("litecointools.com", 9333, true);
299+
CService ip("darkcoin.io", 9999, true);
300300
vector<CAddress> vAddr;
301301
vAddr.clear();
302302
int ban = 0;

combine.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ sub combine {
5858
}
5959

6060
for my $addr (sort { $res->{$b} <=> $res->{$a} } (keys %{$res})) {
61-
if ($addr =~ /\A(\d+)\.(\d+)\.(\d+)\.(\d+):9333/) {
61+
if ($addr =~ /\A(\d+)\.(\d+)\.(\d+)\.(\d+):9999/) {
6262
my $a = $1*0x1000000 + $2*0x10000 + $3*0x100 + $4;
6363
printf "0x%08x %s %g%%\n",$a,$addr,(1-((1-$res->{$addr}) ** (1/$n)))*100;
6464
}

db.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
#define MIN_RETRY 1000
1414

15-
#define REQUIRE_VERSION 70002
15+
#define REQUIRE_VERSION 70018
1616

1717
static inline int GetRequireHeight(const bool testnet = fTestNet)
1818
{
19-
return testnet ? 0 : 470000;
19+
return testnet ? 0 : 96900;
2020
}
2121

2222
std::string static inline ToString(const CService &ip) {
@@ -119,7 +119,7 @@ class CAddrInfo {
119119
}
120120
int GetBanTime() const {
121121
if (IsGood()) return 0;
122-
if (clientVersion && clientVersion < 50000) { return 604800; }
122+
if (clientVersion && clientVersion < 91100) { return 604800; }
123123
if (stat1M.reliability - stat1M.weight + 1.0 < 0.15 && stat1M.count > 32) { return 30*86400; }
124124
if (stat1W.reliability - stat1W.weight + 1.0 < 0.10 && stat1W.count > 16) { return 7*86400; }
125125
if (stat1D.reliability - stat1D.weight + 1.0 < 0.05 && stat1D.count > 8) { return 1*86400; }

main.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class CDnsSeedOpts {
3131
CDnsSeedOpts() : nThreads(96), nDnsThreads(4), nPort(53), mbox(NULL), ns(NULL), host(NULL), tor(NULL), fUseTestNet(false), fWipeBan(false), fWipeIgnore(false) {}
3232

3333
void ParseCommandLine(int argc, char **argv) {
34-
static const char *help = "Litecoin-seeder\n"
34+
static const char *help = "Darkcoin-seeder\n"
3535
"Usage: %s -h <host> -n <ns> [-m <mbox>] [-t <threads>] [-p <port>]\n"
3636
"\n"
3737
"Options:\n"
@@ -342,13 +342,13 @@ extern "C" void* ThreadStats(void*) {
342342
} while(1);
343343
}
344344

345-
static const string mainnet_seeds[] = {"dnsseed.litecointools.com", "dnsseed.litecoinpool.org", "dnsseed.ltc.xurious.com", ""};
346-
static const string testnet_seeds[] = {"testnet-seed.litecointools.com", ""};
345+
static const string mainnet_seeds[] = {"static-dnsseed.darkcoin.io", "static-dnsseed.darkcoin.qa", ""};
346+
static const string testnet_seeds[] = {"static-testnet-seed.darkcoin.io", "static-testnet-seed.darkcoin.qa", ""};
347347
static const string *seeds = mainnet_seeds;
348348

349349
extern "C" void* ThreadSeeder(void*) {
350350
if (!fTestNet){
351-
db.Add(CService("kjy2eqzk4zwi5zd3.onion", 9333), true);
351+
db.Add(CService("kjy2eqzk4zwi5zd3.onion", 9999), true);
352352
}
353353
do {
354354
for (int i=0; seeds[i] != ""; i++) {
@@ -377,10 +377,10 @@ int main(int argc, char **argv) {
377377
bool fDNS = true;
378378
if (opts.fUseTestNet) {
379379
printf("Using testnet.\n");
380-
pchMessageStart[0] = 0xfc;
381-
pchMessageStart[1] = 0xc1;
382-
pchMessageStart[2] = 0xb7;
383-
pchMessageStart[3] = 0xdc;
380+
pchMessageStart[0] = 0xce;
381+
pchMessageStart[1] = 0xe2;
382+
pchMessageStart[2] = 0xca;
383+
pchMessageStart[3] = 0xff;
384384
seeds = testnet_seeds;
385385
fTestNet = true;
386386
}

protocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static const char* ppszTypeName[] =
2222
"block",
2323
};
2424

25-
unsigned char pchMessageStart[4] = { 0xfb, 0xc0, 0xb6, 0xdb };
25+
unsigned char pchMessageStart[4] = { 0xbf, 0x0c, 0x6b, 0xbd };
2626

2727
CMessageHeader::CMessageHeader()
2828
{

protocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
extern bool fTestNet;
1919
static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
2020
{
21-
return testnet ? 19333 : 9333;
21+
return testnet ? 19999 : 9999;
2222
}
2323

2424
//

serialize.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class CDataStream;
6060
class CAutoFile;
6161
static const unsigned int MAX_SIZE = 0x02000000;
6262

63-
static const int PROTOCOL_VERSION = 70002;
63+
static const int PROTOCOL_VERSION = 70018;
6464

6565
// Used to bypass the rule against non-const reference to temporary
6666
// where it makes sense with wrappers such as CFlatData or CTxDB

0 commit comments

Comments
 (0)