Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mainnet overwinter #1

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "/zcash-seeder:0.01/";
vSend << PROTOCOL_VERSION << nLocalServices << nTime << you << me << nLocalNonce << ver << nBestHeight;
EndMessage();
}
Expand Down
5 changes: 3 additions & 2 deletions db.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@

#define MIN_RETRY 1000

#define REQUIRE_VERSION 70001
#define REQUIRE_VERSION 170005

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

std::string static inline ToString(const CService &ip) {
Expand Down
28 changes: 12 additions & 16 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ class CDnsSeedOpts {
host = optarg;
break;
}

case 'm': {
mbox = optarg;
break;
}

case 'n': {
ns = optarg;
break;
}

case 't': {
int n = strtol(optarg, NULL, 10);
if (n > 0 && n < 1000) nThreads = n;
Expand Down Expand Up @@ -389,18 +389,14 @@ 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.alexykot.me",
"testnet-seed.bitcoin.petertodd.org",
"testnet-seed.bluematt.me",
"testnet-seed.bitcoin.schildbach.de",
""};
static const string mainnet_seeds[] = {"mainnet.z.cash", "dnsseed.str4d.xyz", "dnsseed.znodes.org", ""};
static const string testnet_seeds[] = {"testnet.z.cash", "explorer.testnet.z.cash", ""};
static const string *seeds = mainnet_seeds;

extern "C" void* ThreadSeeder(void*) {
if (!fTestNet){
db.Add(CService("kjy2eqzk4zwi5zd3.onion", 8333), true);
}
//if (!fTestNet){
// db.Add(CService("kjy2eqzk4zwi5zd3.onion", 8333), true);
//}
do {
for (int i=0; seeds[i] != ""; i++) {
vector<CNetAddr> ips;
Expand Down Expand Up @@ -450,10 +446,10 @@ 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;
pchMessageStart[0] = 0xFA;
pchMessageStart[1] = 0x1A;
pchMessageStart[2] = 0x24;
pchMessageStart[3] = 0xB6;
seeds = testnet_seeds;
fTestNet = true;
}
Expand Down
2 changes: 1 addition & 1 deletion protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static const char* ppszTypeName[] =
"block",
};

unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
unsigned char pchMessageStart[4] = { 0x24, 0xE9, 0x27, 0x64 };

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

//
Expand Down
2 changes: 1 addition & 1 deletion serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CDataStream;
class CAutoFile;
static const unsigned int MAX_SIZE = 0x02000000;

static const int PROTOCOL_VERSION = 60000;
static const int PROTOCOL_VERSION = 170005;

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