modified: src/chainparams.cpp
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3m28s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3m28s
This commit is contained in:
parent
def0cb051a
commit
209b541daf
@ -18,8 +18,6 @@
|
||||
|
||||
#include "chainparamsseeds.h"
|
||||
|
||||
#include "arith_uint256.h"
|
||||
|
||||
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
|
||||
{
|
||||
CMutableTransaction txNew;
|
||||
@ -83,7 +81,7 @@ public:
|
||||
consensus.nMajorityRejectBlockOutdated = 950;
|
||||
consensus.nMajorityWindow = 1000;
|
||||
consensus.BIP34Height = 0;
|
||||
consensus.BIP34Hash = uint256S("0x0000077d4fc6f4c8e65b2fb355b1fa6c663d33712079d8cbe503fca647f8217b");
|
||||
consensus.BIP34Hash = uint256S("0x0000031f3ddf0598c05670f5ee9aa5132ac4d22cf71d77d7e46853903cf2fa4e");
|
||||
consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
||||
consensus.nPowTargetTimespan = 12 * 60 * 60; // 12h retarget
|
||||
consensus.nPowTargetSpacing = 5 * 60; // 5 minutes
|
||||
@ -114,49 +112,10 @@ public:
|
||||
nMaxTipAge = 6 * 60 * 60; // ~144 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin
|
||||
nPruneAfterHeight = 100000;
|
||||
|
||||
genesis = CreateGenesisBlock(1689725227, 175619, 0x1e0ffff0, 1, 50 * COIN);
|
||||
consensus.hashGenesisBlock = genesis.GetHash();
|
||||
/*
|
||||
// calculate Genesis Block
|
||||
// Reset genesis
|
||||
consensus.hashGenesisBlock = uint256S("0x");
|
||||
std::cout << std::string("Begin calculating Mainnet Genesis Block:\n");
|
||||
if (true && (genesis.GetHash() != consensus.hashGenesisBlock)) {
|
||||
LogPrintf("Calculating Mainnet Genesis Block:\n");
|
||||
arith_uint256 hashTarget = arith_uint256().SetCompact(genesis.nBits);
|
||||
uint256 hash;
|
||||
genesis.nNonce = 0;
|
||||
// This will figure out a valid hash and Nonce if you're
|
||||
// creating a different genesis block:
|
||||
// uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256();
|
||||
// hashTarget.SetCompact(genesis.nBits, &fNegative, &fOverflow).getuint256();
|
||||
// while (genesis.GetHash() > hashTarget)
|
||||
while (UintToArith256(genesis.GetHash()) > hashTarget)
|
||||
{
|
||||
++genesis.nNonce;
|
||||
if (genesis.nNonce == 0)
|
||||
{
|
||||
LogPrintf("NONCE WRAPPED, incrementing time");
|
||||
std::cout << std::string("NONCE WRAPPED, incrementing time:\n");
|
||||
++genesis.nTime;
|
||||
}
|
||||
if (genesis.nNonce % 10000 == 0)
|
||||
{
|
||||
LogPrintf("Mainnet: nonce %08u: hash = %s \n", genesis.nNonce, genesis.GetHash().ToString().c_str());
|
||||
// std::cout << strNetworkID << " nonce: " << genesis.nNonce << " time: " << genesis.nTime << " hash: " << genesis.GetHash().ToString().c_str() << "\n";
|
||||
}
|
||||
}
|
||||
std::cout << "Mainnet ---\n";
|
||||
std::cout << " nonce: " << genesis.nNonce << "\n";
|
||||
std::cout << " time: " << genesis.nTime << "\n";
|
||||
std::cout << " hash: " << genesis.GetHash().ToString().c_str() << "\n";
|
||||
std::cout << " merklehash: " << genesis.hashMerkleRoot.ToString().c_str() << "\n";
|
||||
// Mainnet --- nonce: 296277 time: 1390095618 hash: 000000bdd771b14e5a031806292305e563956ce2584278de414d9965f6ab54b0
|
||||
}
|
||||
std::cout << std::string("Finished calculating Mainnet Genesis Block:\n");
|
||||
*/
|
||||
assert(consensus.hashGenesisBlock == uint256S("0x0000077d4fc6f4c8e65b2fb355b1fa6c663d33712079d8cbe503fca647f8217b"));
|
||||
assert(genesis.hashMerkleRoot == uint256S("0x8297f1d73303264381c48e41be910695fea3cbf8367ea220197f100c248f6008"));
|
||||
genesis = CreateGenesisBlock(1689725227, 258731, 0x1e0ffff0, 1, 50 * COIN);
|
||||
consensus.hashGenesisBlock = genesis.GetHash();
|
||||
assert(consensus.hashGenesisBlock == uint256S("0x0000031f3ddf0598c05670f5ee9aa5132ac4d22cf71d77d7e46853903cf2fa4e"));
|
||||
assert(genesis.hashMerkleRoot == uint256S("0x089b49a54f96865eabaadd77148aeae924cde0808821794f1d0f19dd0fe879ee"));
|
||||
|
||||
|
||||
vSeeds.push_back(CDNSSeedData("neobytes.io", "seed.neobytes.io"));
|
||||
@ -190,7 +149,7 @@ public:
|
||||
|
||||
checkpointData = (CCheckpointData) {
|
||||
boost::assign::map_list_of
|
||||
( 0, uint256S("0x0000077d4fc6f4c8e65b2fb355b1fa6c663d33712079d8cbe503fca647f8217b")),
|
||||
( 0, uint256S("0x0000031f3ddf0598c05670f5ee9aa5132ac4d22cf71d77d7e46853903cf2fa4e")),
|
||||
1689725227, // * UNIX timestamp of last checkpoint block
|
||||
0, // * total number of transactions between genesis and last checkpoint
|
||||
// (the tx=... number in the SetBestChain debug.log lines)
|
||||
@ -225,7 +184,7 @@ public:
|
||||
consensus.nMajorityRejectBlockOutdated = 75;
|
||||
consensus.nMajorityWindow = 100;
|
||||
consensus.BIP34Height = 0;
|
||||
consensus.BIP34Hash = uint256S("0x000006f76d06a4b15692023eeb6f1df2dc3e98ac2eb1f11d8f4eb36ac4aca1db");
|
||||
consensus.BIP34Hash = uint256S("0x000008bd9b0f73536def90daf48e53370c59d0b44541469d4daabfc7a9235d89");
|
||||
consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
||||
consensus.nPowTargetTimespan = 12 * 60 * 60; // 12h retarget
|
||||
consensus.nPowTargetSpacing = 5 * 60; // 5 minutes
|
||||
@ -251,49 +210,10 @@ public:
|
||||
nMaxTipAge = 0x7fffffff; // allow mining on top of old blocks for testnet
|
||||
nPruneAfterHeight = 1000;
|
||||
|
||||
genesis = CreateGenesisBlock(1622466128, 1333937, 0x1e0ffff0, 1, 50 * COIN);
|
||||
genesis = CreateGenesisBlock(1622466128, 1655988, 0x1e0ffff0, 1, 50 * COIN);
|
||||
consensus.hashGenesisBlock = genesis.GetHash();
|
||||
/*
|
||||
// calculate Genesis Block
|
||||
// Reset genesis
|
||||
consensus.hashGenesisBlock = uint256S("0x");
|
||||
std::cout << std::string("Begin calculating Testnet Genesis Block:\n");
|
||||
if (true && (genesis.GetHash() != consensus.hashGenesisBlock)) {
|
||||
LogPrintf("Calculating Testnet Genesis Block:\n");
|
||||
arith_uint256 hashTarget = arith_uint256().SetCompact(genesis.nBits);
|
||||
uint256 hash;
|
||||
genesis.nNonce = 0;
|
||||
// This will figure out a valid hash and Nonce if you're
|
||||
// creating a different genesis block:
|
||||
// uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256();
|
||||
// hashTarget.SetCompact(genesis.nBits, &fNegative, &fOverflow).getuint256();
|
||||
// while (genesis.GetHash() > hashTarget)
|
||||
while (UintToArith256(genesis.GetHash()) > hashTarget)
|
||||
{
|
||||
++genesis.nNonce;
|
||||
if (genesis.nNonce == 0)
|
||||
{
|
||||
LogPrintf("NONCE WRAPPED, incrementing time");
|
||||
std::cout << std::string("NONCE WRAPPED, incrementing time:\n");
|
||||
++genesis.nTime;
|
||||
}
|
||||
if (genesis.nNonce % 10000 == 0)
|
||||
{
|
||||
LogPrintf("Testnet: nonce %08u: hash = %s \n", genesis.nNonce, genesis.GetHash().ToString().c_str());
|
||||
// std::cout << strNetworkID << " nonce: " << genesis.nNonce << " time: " << genesis.nTime << " hash: " << genesis.GetHash().ToString().c_str() << "\n";
|
||||
}
|
||||
}
|
||||
std::cout << "Testnet ---\n";
|
||||
std::cout << " nonce: " << genesis.nNonce << "\n";
|
||||
std::cout << " time: " << genesis.nTime << "\n";
|
||||
std::cout << " hash: " << genesis.GetHash().ToString().c_str() << "\n";
|
||||
std::cout << " merklehash: " << genesis.hashMerkleRoot.ToString().c_str() << "\n";
|
||||
// Mainnet --- nonce: 296277 time: 1390095618 hash: 000000bdd771b14e5a031806292305e563956ce2584278de414d9965f6ab54b0
|
||||
}
|
||||
std::cout << std::string("Finished calculating Testnet Genesis Block:\n");
|
||||
*/
|
||||
assert(consensus.hashGenesisBlock == uint256S("0x000006f76d06a4b15692023eeb6f1df2dc3e98ac2eb1f11d8f4eb36ac4aca1db"));
|
||||
assert(genesis.hashMerkleRoot == uint256S("0x8297f1d73303264381c48e41be910695fea3cbf8367ea220197f100c248f6008"));
|
||||
assert(consensus.hashGenesisBlock == uint256S("0x000008bd9b0f73536def90daf48e53370c59d0b44541469d4daabfc7a9235d89"));
|
||||
assert(genesis.hashMerkleRoot == uint256S("0x089b49a54f96865eabaadd77148aeae924cde0808821794f1d0f19dd0fe879ee"));
|
||||
|
||||
vFixedSeeds.clear();
|
||||
vSeeds.clear();
|
||||
@ -328,7 +248,7 @@ public:
|
||||
|
||||
checkpointData = (CCheckpointData) {
|
||||
boost::assign::map_list_of
|
||||
( 0, uint256S("0x000006f76d06a4b15692023eeb6f1df2dc3e98ac2eb1f11d8f4eb36ac4aca1db")),
|
||||
( 0, uint256S("0x000008bd9b0f73536def90daf48e53370c59d0b44541469d4daabfc7a9235d89")),
|
||||
1622466128, // * UNIX timestamp of last checkpoint block
|
||||
0, // * total number of transactions between genesis and last checkpoint
|
||||
// (the tx=... number in the SetBestChain debug.log lines)
|
||||
@ -389,47 +309,8 @@ public:
|
||||
|
||||
genesis = CreateGenesisBlock(1622466748, 0, 0x207fffff, 1, 50 * COIN);
|
||||
consensus.hashGenesisBlock = genesis.GetHash();
|
||||
/*
|
||||
// calculate Genesis Block
|
||||
// Reset genesis
|
||||
consensus.hashGenesisBlock = uint256S("0x");
|
||||
std::cout << std::string("Begin calculating Regtest Genesis Block:\n");
|
||||
if (true && (genesis.GetHash() != consensus.hashGenesisBlock)) {
|
||||
LogPrintf("Calculating Regtest Genesis Block:\n");
|
||||
arith_uint256 hashTarget = arith_uint256().SetCompact(genesis.nBits);
|
||||
uint256 hash;
|
||||
genesis.nNonce = 0;
|
||||
// This will figure out a valid hash and Nonce if you're
|
||||
// creating a different genesis block:
|
||||
// uint256 hashTarget = CBigNum().SetCompact(genesis.nBits).getuint256();
|
||||
// hashTarget.SetCompact(genesis.nBits, &fNegative, &fOverflow).getuint256();
|
||||
// while (genesis.GetHash() > hashTarget)
|
||||
while (UintToArith256(genesis.GetHash()) > hashTarget)
|
||||
{
|
||||
++genesis.nNonce;
|
||||
if (genesis.nNonce == 0)
|
||||
{
|
||||
LogPrintf("NONCE WRAPPED, incrementing time");
|
||||
std::cout << std::string("NONCE WRAPPED, incrementing time:\n");
|
||||
++genesis.nTime;
|
||||
}
|
||||
if (genesis.nNonce % 10000 == 0)
|
||||
{
|
||||
LogPrintf("Regtest: nonce %08u: hash = %s \n", genesis.nNonce, genesis.GetHash().ToString().c_str());
|
||||
// std::cout << strNetworkID << " nonce: " << genesis.nNonce << " time: " << genesis.nTime << " hash: " << genesis.GetHash().ToString().c_str() << "\n";
|
||||
}
|
||||
}
|
||||
std::cout << "Regtest ---\n";
|
||||
std::cout << " nonce: " << genesis.nNonce << "\n";
|
||||
std::cout << " time: " << genesis.nTime << "\n";
|
||||
std::cout << " hash: " << genesis.GetHash().ToString().c_str() << "\n";
|
||||
std::cout << " merklehash: " << genesis.hashMerkleRoot.ToString().c_str() << "\n";
|
||||
// Mainnet --- nonce: 296277 time: 1390095618 hash: 000000bdd771b14e5a031806292305e563956ce2584278de414d9965f6ab54b0
|
||||
}
|
||||
std::cout << std::string("Finished calculating Regtest Genesis Block:\n");
|
||||
*/
|
||||
assert(consensus.hashGenesisBlock == uint256S("0x3d50b166b956ad8a283e5208f68e0a00ae661924b8e0a34395a79e878c80d97f"));
|
||||
assert(genesis.hashMerkleRoot == uint256S("0x8297f1d73303264381c48e41be910695fea3cbf8367ea220197f100c248f6008"));
|
||||
assert(consensus.hashGenesisBlock == uint256S("0x322cb9ae2cb1c4279e9f9a38f1fc53bdd1a4eb862d8ea21bc0be2e37b7715f1b"));
|
||||
assert(genesis.hashMerkleRoot == uint256S("0x089b49a54f96865eabaadd77148aeae924cde0808821794f1d0f19dd0fe879ee"));
|
||||
|
||||
vFixedSeeds.clear(); //! Regtest mode doesn't have any fixed seeds.
|
||||
vSeeds.clear(); //! Regtest mode doesn't have any DNS seeds.
|
||||
@ -444,7 +325,7 @@ public:
|
||||
|
||||
checkpointData = (CCheckpointData){
|
||||
boost::assign::map_list_of
|
||||
( 0, uint256S("0x3d50b166b956ad8a283e5208f68e0a00ae661924b8e0a34395a79e878c80d97f")),
|
||||
( 0, uint256S("0x322cb9ae2cb1c4279e9f9a38f1fc53bdd1a4eb862d8ea21bc0be2e37b7715f1b")),
|
||||
0,
|
||||
0,
|
||||
0
|
||||
|
Loading…
Reference in New Issue
Block a user