diff --git a/contrib/seeds/nodes_main.txt b/contrib/seeds/nodes_main.txt index 01620a6b5..1e8dcf28c 100644 --- a/contrib/seeds/nodes_main.txt +++ b/contrib/seeds/nodes_main.txt @@ -1 +1 @@ -52.38.179.128 +100.21.116.119 diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 250f0a888..4e2eb0a99 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -113,13 +113,6 @@ static int AppInitRPC(int argc, char* argv[]) return EXIT_FAILURE; } -#if 1 - if (ChainNameFromCommandLine() == CBaseChainParams::MAIN) { - printf("\nMainnet is not live yet, use \"-testnet\" option to connect to the testnet.\n\n"); - exit(1); - } -#endif - // Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause) try { SelectBaseParams(ChainNameFromCommandLine()); diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index cc408b6c3..81bf41d80 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -101,13 +101,6 @@ bool AppInit(int argc, char* argv[]) return false; } -#if 1 - if (ChainNameFromCommandLine() == CBaseChainParams::MAIN) { - printf("\nMainnet is not live yet, use \"-testnet\" option to connect to the testnet.\n\n"); - exit(1); - } -#endif - // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) try { SelectParams(ChainNameFromCommandLine()); diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 90e91172f..49d62f5bb 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -16,7 +16,10 @@ #include -static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward) +/** + * For Test net and Reg Test. + */ +static CBlock CreateGenesisBlockTest(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward) { CMutableTransaction txNew; txNew.nVersion = 1; @@ -41,12 +44,50 @@ static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesi return genesis; } -static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward) +static CBlock CreateGenesisBlockTest(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward) { - // RELEASE TODO: change timestamp const char* pszTimestamp = "The Economist 27/Sept/2019 Repo-market ructions were a reminder of the financial crisis"; const CScript genesisOutputScript = CScript() << ParseHex("a914676a24ba4bfadd458e5245b26fa57f9a62ca185087"); - return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward); + return CreateGenesisBlockTest(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward); +} + +/** + * For Main net. + */ +static CBlock CreateGenesisBlockMain(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward) +{ + CMutableTransaction txNew; + txNew.nVersion = 1; + txNew.vin.resize(1); + txNew.vout.resize(1); + txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp)); + txNew.vout[0].nValue = genesisReward; + txNew.vout[0].scriptPubKey = genesisOutputScript; + + CBlock genesis; + genesis.nTime = nTime; + genesis.nBits = nBits; + genesis.nNonce = 0; // Used as height. + genesis.nVersion = nVersion; + genesis.vtx.push_back(MakeTransactionRef(std::move(txNew))); + genesis.hashPrevBlock.SetNull(); + genesis.hashMerkleRoot = BlockMerkleRoot(genesis); + + genesis.cnHeader.major_version = 10; // Cryptonight variant 4 + genesis.cnHeader.minor_version = 0; + genesis.cnHeader.prev_id = genesis.GetOriginalBlockHash(); + genesis.cnHeader.merkle_root = uint256S("0x09bafe2103d3588f80ef5a876f3b24fc1fc277d7105798e163600652dc02de6f"); + genesis.cnHeader.nonce = nNonce; + genesis.cnHeader.timestamp = nTime; + genesis.cnHeader.nTxes = 1; + return genesis; +} + +static CBlock CreateGenesisBlockMain(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward) +{ + const char* pszTimestamp = "Thank You Satoshi 612997 2020-01-15 11:40:41 7f31f44d"; + const CScript genesisOutputScript = CScript() << ParseHex("a914676a24ba4bfadd458e5245b26fa57f9a62ca185087"); + return CreateGenesisBlockMain(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward); } void CChainParams::UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout) @@ -99,7 +140,7 @@ public: consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1517356801; // January 31st, 2018 // The best chain should have at least this much work. - consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000001000000"); + consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000000000000000FF000"); // By default assume that the signatures in ancestors of this block are valid. consensus.defaultAssumeValid = uint256S("0x00"); @@ -117,11 +158,10 @@ public: nPruneAfterHeight = 100000; const uint32_t genesisBlockReward = 0.00001 * COIN; // A small reward for the core developers :-) - //TODO: target: 0x1e0fffff, update timestampe and nonce. - genesis = CreateGenesisBlock(1553145843, 1621, 0x1e0fffff, 1, genesisBlockReward); + genesis = CreateGenesisBlockMain(1579143600, 585290, 0x1e0fffff, 1, genesisBlockReward); consensus.hashGenesisBlock = genesis.GetHash(); - assert(consensus.hashGenesisBlock == uint256S("0x2f6d82a919bfc055f9e66e82bd613050cb835f969563f217737c9ef631668f6c")); - assert(genesis.hashMerkleRoot == uint256S("0x285139132ff0b33d399aae61053d19b34fe8e483053142d530d62d90881183c9")); + assert(consensus.hashGenesisBlock == uint256S("0x70bd30ae775c691fc8a2b7d27f37279a4f505f877e3234105f22e963a618597c")); + assert(genesis.hashMerkleRoot == uint256S("0xe6104a982da24d09ccf867aba92abbd31b2ede9da636941367709c5ef24d3330")); // Note that of those with the service bits flag, most only support a subset of possible options vSeeds.emplace_back("dnsseed.kevacoin.org"); @@ -206,7 +246,7 @@ public: nDefaultPort = 19335; nPruneAfterHeight = 1000; - genesis = CreateGenesisBlock(1573082080, 11061, 0x1f0ffff0, 1, 500 * COIN); + genesis = CreateGenesisBlockTest(1573082080, 11061, 0x1f0ffff0, 1, 500 * COIN); consensus.hashGenesisBlock = genesis.GetHash(); assert(consensus.hashGenesisBlock == uint256S("a540f9f5826989d09baef56b4f43ea8ef7638f99e870327c1cc552626cbf8e4e")); assert(genesis.hashMerkleRoot == uint256S("d85a90623fbff6a5ea4b80df1dbc81b32de7f1011f484e186cfb7cf2d4292c95")); @@ -291,7 +331,7 @@ public: nDefaultPort = 19444; nPruneAfterHeight = 1000; - genesis = CreateGenesisBlock(1296688602, 0, 0x207fffff, 1, 50 * COIN); + genesis = CreateGenesisBlockTest(1296688602, 0, 0x207fffff, 1, 50 * COIN); consensus.hashGenesisBlock = genesis.GetHash(); assert(consensus.hashGenesisBlock == uint256S("0x5b2e996d458adbf5c81b381f90ca167732bc9f4e9c1c4ec8485fa74efe793ed8")); assert(genesis.hashMerkleRoot == uint256S("0x13ec98c3307b8e6b67b91c605c7347916a99f9dfde7b5d88365aaef322192314")); diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index 56cf3b22c..7695c3bb9 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -8,11 +8,10 @@ * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly. */ static SeedSpec6 pnSeed6_main[] = { - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0x26,0xb3,0x80}, 9338} + {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x64,0x15,0x74,0x77}, 9338} }; static SeedSpec6 pnSeed6_test[] = { }; - #endif // BITCOIN_CHAINPARAMSSEEDS_H diff --git a/src/init.cpp b/src/init.cpp index a9414467a..a9eea5b6f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1461,12 +1461,6 @@ bool AppInitMain() break; } -#if 1 - if (ChainNameFromCommandLine() == CBaseChainParams::MAIN) { - return InitError(_("Mainnet is not live yet, use \"-testnet\" option to connect to the testnet.")); - } -#endif - // If the loaded chain has a wrong genesis, bail out immediately // (we're likely using a testnet datadir, or the other way around). if (!mapBlockIndex.empty() && mapBlockIndex.count(chainparams.GetConsensus().hashGenesisBlock) == 0)