mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-14 00:58:09 +00:00
Properly fixed testnet checking.
This commit is contained in:
parent
6dd2e1a8fd
commit
166d96ea1c
@ -112,6 +112,14 @@ static int AppInitRPC(int argc, char* argv[])
|
||||
fprintf(stderr,"Error reading configuration file: %s\n", e.what());
|
||||
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());
|
||||
|
@ -100,6 +100,14 @@ bool AppInit(int argc, char* argv[])
|
||||
fprintf(stderr,"Error reading configuration file: %s\n", e.what());
|
||||
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());
|
||||
|
@ -116,10 +116,6 @@ public:
|
||||
//TODO: target: 0x1e0fffff, update timestampe and nonce.
|
||||
genesis = CreateGenesisBlock(1543789622, 3302, 0x1f0ffff0, 1, genesisBlockReward);
|
||||
|
||||
#if 1
|
||||
printf("\nMainnet is not live yet, use -testnet to connect to the testnet.\n\n");
|
||||
exit(1);
|
||||
#endif
|
||||
consensus.hashGenesisBlock = genesis.GetHash();
|
||||
assert(consensus.hashGenesisBlock == uint256S("0x77c037d74bc51b535629537c8e9530340ea12272f43d261a0ee59e8f2ad0e6f6"));
|
||||
assert(genesis.hashMerkleRoot == uint256S("0xb21d4680875c0e472b7dbf3dbab2aaeb2dbbb5fa8b154f978b5ea0706d1fd5b9"));
|
||||
|
@ -1461,6 +1461,12 @@ 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)
|
||||
|
Loading…
Reference in New Issue
Block a user