This commit is contained in:
myriadcoin
2014-08-08 02:52:33 +02:00
parent 11736d62dd
commit 4739dcdb44
654 changed files with 190612 additions and 62862 deletions
+30 -53
View File
@@ -1,15 +1,19 @@
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "assert.h"
#include "chainparams.h"
#include "assert.h"
#include "core.h"
#include "protocol.h"
#include "util.h"
#include <boost/assign/list_of.hpp>
using namespace boost::assign;
//
// Main network
//
@@ -23,6 +27,8 @@ class CMainParams : public CChainParams {
public:
CMainParams() {
// The message start string is designed to be unlikely to occur in normal data.
// The characters are rarely used upper ASCII, not valid as UTF-8, and produce
// a large 4-byte int at any alignment.
pchMessageStart[0] = 0xaf;
pchMessageStart[1] = 0x45;
pchMessageStart[2] = 0x76;
@@ -39,7 +45,6 @@ public:
// Build the genesis block. Note that the output of the genesis coinbase cannot
// be spent as it did not originally exist in the database.
const char* pszTimestamp = "2014-02-23 FT - G20 aims to add $2tn to global economy";
CTransaction txNew;
txNew.vin.resize(1);
@@ -54,19 +59,8 @@ public:
genesis.nTime = 1393164995;
genesis.nBits = 0x1e0fffff;
genesis.nNonce = 2092903596;
//// debug print
hashGenesisBlock = genesis.GetHash();
//while (hashGenesisBlock > bnProofOfWorkLimit[ALGO_SHA256D].getuint256()){
// if (++genesis.nNonce==0) break;
// hashGenesisBlock = genesis.GetHash();
//}
//printf("MAIN: %s\n", hashGenesisBlock.ToString().c_str());
//printf("%s\n", genesis.hashMerkleRoot.ToString().c_str());
//printf("%x\n", bnProofOfWorkLimit[ALGO_SHA256D].GetCompact());
//genesis.print();
hashGenesisBlock = genesis.GetHash();
assert(hashGenesisBlock == uint256("0x00000ffde4c020b5938441a0ea3d314bf619eff0b38f32f78f7583cffa1ea485"));
assert(genesis.hashMerkleRoot == uint256("0x3f75db3c18e92f46c21530dc1222e1fddf4ccebbf88e289a6c9dc787fd6469da"));
@@ -75,21 +69,24 @@ public:
vSeeds.push_back(CDNSSeedData("seed3.myriadcoin.org", "seed3.myriadcoin.org"));
vSeeds.push_back(CDNSSeedData("seed4.myriadcoin.org", "seed4.myriadcoin.org"));
base58Prefixes[PUBKEY_ADDRESS] = 50;
base58Prefixes[SCRIPT_ADDRESS] = 9;
base58Prefixes[SECRET_KEY] = 178;
base58Prefixes[PUBKEY_ADDRESS] = list_of(50);
base58Prefixes[SCRIPT_ADDRESS] = list_of(9);
base58Prefixes[SECRET_KEY] = list_of(178);
base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x88)(0xB2)(0x1E);
base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x88)(0xAD)(0xE4);
// Convert the pnSeeds array into usable address objects.
for (unsigned int i = 0; i < ARRAYLEN(pnSeed); i++)
{
// It'll only connect to one or two seed nodes because once it connects,
// it'll get a pile of addresses with newer timestamps.
// Seed nodes are given a random 'last seen time'
const int64 nTwoDays = 2 * 24 * 60 * 60;
// Seed nodes are given a random 'last seen time' of between one and two
// weeks ago.
const int64_t nOneWeek = 7*24*60*60;
struct in_addr ip;
memcpy(&ip, &pnSeed[i], sizeof(ip));
CAddress addr(CService(ip, GetDefaultPort()));
addr.nTime = GetTime() - GetRand(nTwoDays) - nTwoDays;
addr.nTime = GetTime() - GetRand(nOneWeek) - nOneWeek;
vFixedSeeds.push_back(addr);
}
}
@@ -114,6 +111,8 @@ class CTestNetParams : public CMainParams {
public:
CTestNetParams() {
// The message start string is designed to be unlikely to occur in normal data.
// The characters are rarely used upper ASCII, not valid as UTF-8, and produce
// a large 4-byte int at any alignment.
pchMessageStart[0] = 0x01;
pchMessageStart[1] = 0xf5;
pchMessageStart[2] = 0x55;
@@ -126,28 +125,18 @@ public:
// Modify the testnet genesis block so the timestamp is valid for a later start.
genesis.nTime = 1392876393;
genesis.nNonce = 416875379;
//// debug print
hashGenesisBlock = genesis.GetHash();
//while (hashGenesisBlock > bnProofOfWorkLimit[ALGO_SHA256D].getuint256()){
// if (++genesis.nNonce==0) break;
// hashGenesisBlock = genesis.GetHash();
//}
//printf("TEST: %s\n", hashGenesisBlock.ToString().c_str());
//printf("%s\n", genesis.hashMerkleRoot.ToString().c_str());
//genesis.print();
assert(hashGenesisBlock == uint256("0x0000017ce2a79c8bddafbbe47c004aa92b20678c354b34085f62b762084b9788"));
vFixedSeeds.clear();
vSeeds.clear();
vSeeds.push_back(CDNSSeedData("testseed1.myriadcoin.org", "testseed1.myriadcoin.org"));
base58Prefixes[PUBKEY_ADDRESS] = 88;
base58Prefixes[SCRIPT_ADDRESS] = 188;
base58Prefixes[SECRET_KEY] = 239;
base58Prefixes[PUBKEY_ADDRESS] = list_of(88);
base58Prefixes[SCRIPT_ADDRESS] = list_of(188);
base58Prefixes[SECRET_KEY] = list_of(239);
base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x35)(0x87)(0xCF);
base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x35)(0x83)(0x94);
}
virtual Network NetworkID() const { return CChainParams::TESTNET; }
};
@@ -176,25 +165,13 @@ public:
hashGenesisBlock = genesis.GetHash();
nDefaultPort = 18444;
strDataDir = "regtest";
//// debug print
hashGenesisBlock = genesis.GetHash();
//while (hashGenesisBlock > bnProofOfWorkLimit[ALGO_SHA256D].getuint256()){
// if (++genesis.nNonce==0) break;
// hashGenesisBlock = genesis.GetHash();
//}
//printf("REG: %s\n", hashGenesisBlock.ToString().c_str());
//printf("%s\n", genesis.hashMerkleRoot.ToString().c_str());
//genesis.print();
assert(hashGenesisBlock == uint256("0x63b92987ddc93808aa33dddc80b3e52948bdfffaf2420bf4cd9c5137b54ea37c"));
vSeeds.clear(); // Regtest mode doesn't have any DNS seeds.
base58Prefixes[PUBKEY_ADDRESS] = 0;
base58Prefixes[SCRIPT_ADDRESS] = 5;
base58Prefixes[SECRET_KEY] = 128;
base58Prefixes[PUBKEY_ADDRESS] = list_of(0);
base58Prefixes[SCRIPT_ADDRESS] = list_of(5);
base58Prefixes[SECRET_KEY] = list_of(128);
}
virtual bool RequireRPCPassword() const { return false; }