From 2e0f83d0a27e05369bec98381af5ec5951ff223c Mon Sep 17 00:00:00 2001 From: Adrian Gallagher Date: Thu, 2 Mar 2017 08:31:13 +1100 Subject: [PATCH] Litecoin: Reset testnet (now testnet4) --- doc/tor.md | 2 +- share/seeds/generate-seeds.py | 2 +- share/seeds/nodes_test.txt | 4 ++-- src/chainparams.cpp | 29 ++++++++++++++--------------- src/chainparamsbase.cpp | 2 +- src/init.cpp | 2 +- src/main.cpp | 6 +++--- 7 files changed, 23 insertions(+), 24 deletions(-) diff --git a/doc/tor.md b/doc/tor.md index 6e4ecff856..2e1915e0dd 100644 --- a/doc/tor.md +++ b/doc/tor.md @@ -43,7 +43,7 @@ config file): HiddenServiceDir /var/lib/tor/bitcoin-service/ HiddenServicePort 9333 127.0.0.1:9333 - HiddenServicePort 19333 127.0.0.1:19333 + HiddenServicePort 19335 127.0.0.1:19335 The directory can be different of course, but (both) port numbers should be equal to your bitcoind's P2P listen port (9333 by default). diff --git a/share/seeds/generate-seeds.py b/share/seeds/generate-seeds.py index 40f3f3d8cb..3c9c4efa5e 100755 --- a/share/seeds/generate-seeds.py +++ b/share/seeds/generate-seeds.py @@ -127,7 +127,7 @@ def main(): process_nodes(g, f, 'pnSeed6_main', 9333) g.write('\n') with open(os.path.join(indir,'nodes_test.txt'),'r') as f: - process_nodes(g, f, 'pnSeed6_test', 19333) + process_nodes(g, f, 'pnSeed6_test', 19335) g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n') if __name__ == '__main__': diff --git a/share/seeds/nodes_test.txt b/share/seeds/nodes_test.txt index 067b8152c3..6cc22f288c 100644 --- a/share/seeds/nodes_test.txt +++ b/share/seeds/nodes_test.txt @@ -1,4 +1,4 @@ # List of fixed seed nodes for testnet -162.243.72.166:19333 -107.191.58.84:19333 \ No newline at end of file +104.236.211.206 +66.178.182.35 \ No newline at end of file diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 7f99e45b7a..92546d888e 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -81,12 +81,12 @@ static const Checkpoints::CCheckpointData data = { static Checkpoints::MapCheckpoints mapCheckpointsTestnet = boost::assign::map_list_of - ( 546, uint256("0xa0fea99a6897f531600c8ae53367b126824fd6a847b2b2b73817a95b8e27e602")) + ( 2056, uint256("0x17748a31ba97afdc9a4f86837a39d287e3e7c7290a08a1d816c5969c78a83289")) ; static const Checkpoints::CCheckpointData dataTestnet = { &mapCheckpointsTestnet, - 1365458829, - 547, + 1487715270, + 8731, 576 }; @@ -199,12 +199,12 @@ public: CTestNetParams() { networkID = CBaseChainParams::TESTNET; strNetworkID = "test"; - pchMessageStart[0] = 0xfc; - pchMessageStart[1] = 0xc1; - pchMessageStart[2] = 0xb7; - pchMessageStart[3] = 0xdc; + pchMessageStart[0] = 0xfd; + pchMessageStart[1] = 0xd2; + pchMessageStart[2] = 0xc8; + pchMessageStart[3] = 0xf1; vAlertPubKey = ParseHex("0449623fc74489a947c4b15d579115591add020e53b3490bf47297dfa3762250625f8ecc2fb4fc59f69bdce8f7080f3167808276ed2c79d297054367566038aa82"); - nDefaultPort = 19333; + nDefaultPort = 19335; nEnforceBlockUpgradeMajority = 51; nRejectBlockOutdatedMajority = 75; nToCheckBlockUpgradeMajority = 100; @@ -214,16 +214,15 @@ public: nMaxTipAge = 0x7fffffff; //! Modify the testnet genesis block so the timestamp is valid for a later start. - genesis.nTime = 1317798646; - genesis.nNonce = 385270584; + genesis.nTime = 1486949366; + genesis.nNonce = 293345; hashGenesisBlock = genesis.GetHash(); - assert(hashGenesisBlock == uint256("0xf5ae71e26c74beacc88382716aced69cddf3dffff24f384e1808905e0188f68f")); + assert(hashGenesisBlock == uint256("0x4966625a4b2851d9fdee139e56211a0d88575f59ed816ff5e6a63deb4e3e29a0")); vFixedSeeds.clear(); vSeeds.clear(); vSeeds.push_back(CDNSSeedData("litecointools.com", "testnet-seed.litecointools.com")); - vSeeds.push_back(CDNSSeedData("xurious.com", "testnet-seed.ltc.xurious.com")); - vSeeds.push_back(CDNSSeedData("wemine-testnet.com", "dnsseed.wemine-testnet.com")); + vSeeds.push_back(CDNSSeedData("loshan.co.uk", "seed-b.litecoin.loshan.co.uk")); base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,111); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,196); @@ -241,8 +240,8 @@ public: fMineBlocksOnDemand = false; fTestnetToBeDeprecatedFieldRPC = true; - // Litecoin: Testnet v2 enforced as of block 400k - nEnforceV2AfterHeight = 400000; + // Litecoin: v2 enforced using Bitcoin's supermajority rule + nEnforceV2AfterHeight = -1; } const Checkpoints::CCheckpointData& Checkpoints() const { diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index b7ec173fc0..4236303846 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -37,7 +37,7 @@ public: { networkID = CBaseChainParams::TESTNET; nRPCPort = 19332; - strDataDir = "testnet3"; + strDataDir = "testnet4"; } }; static CBaseTestNetParams testNetParams; diff --git a/src/init.cpp b/src/init.cpp index 0c3a2c5c66..7b32d6ff98 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -284,7 +284,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -onion= " + strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy") + "\n"; strUsage += " -onlynet= " + _("Only connect to nodes in network (ipv4, ipv6 or onion)") + "\n"; strUsage += " -permitbaremultisig " + strprintf(_("Relay non-P2SH multisig (default: %u)"), 1) + "\n"; - strUsage += " -port= " + strprintf(_("Listen for connections on (default: %u or testnet: %u)"), 9333, 19333) + "\n"; + strUsage += " -port= " + strprintf(_("Listen for connections on (default: %u or testnet: %u)"), 9333, 19335) + "\n"; strUsage += " -proxy= " + _("Connect through SOCKS5 proxy") + "\n"; strUsage += " -seednode= " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n"; strUsage += " -timeout= " + strprintf(_("Specify connection timeout in milliseconds (minimum: 1, default: %d)"), DEFAULT_CONNECT_TIMEOUT) + "\n"; diff --git a/src/main.cpp b/src/main.cpp index 4037fa482e..53e122c362 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2552,19 +2552,19 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta if (pcheckpoint && nHeight < pcheckpoint->nHeight) return state.DoS(100, error("%s : forked chain older than last checkpoint (height %d)", __func__, nHeight)); - // Litecoin: Reject block.nVersion=1 blocks (mainnet >= 710000, testnet >= 400000, regtest uses supermajority) + // Litecoin: Reject block.nVersion=1 blocks (mainnet >= 710000, testnet & regtest uses supermajority) bool enforceV2 = false; if (block.nVersion < 2) { if (Params().EnforceV2AfterHeight() != -1) { - // Mainnet 710k, Testnet 400k + // Mainnet 710k if (nHeight >= Params().EnforceV2AfterHeight()) enforceV2 = true; } else { - // Regtest and Unittest: use Bitcoin's supermajority rule + // Testnet, Regtest and Unittest: use Bitcoin's supermajority rule if (CBlockIndex::IsSuperMajority(2, pindexPrev, Params().RejectBlockOutdatedMajority())) enforceV2 = true; }