| 33 | #include <chainparamsseeds.h> |
| 34 | |
| 35 | static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward) |
| 36 | { |
| 37 | CMutableTransaction txNew; |
| 38 | txNew.nVersion = 1; |
| 39 | txNew.vin.resize(1); |
| 40 | txNew.vout.resize(1); |
| 41 | txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp)); |
| 42 | txNew.vout[0].nValue = genesisReward; |
| 43 | txNew.vout[0].scriptPubKey = genesisOutputScript; |
| 44 | |
| 45 | CBlock genesis; |
| 46 | genesis.nTime = nTime; |
| 47 | genesis.nBits = nBits; |
| 48 | genesis.nNonce = ArithToUint256(arith_uint256(nNonce)); |
| 49 | genesis.nVersion = nVersion; |
| 50 | genesis.vtx.push_back(MakeTransactionRef(std::move(txNew))); |
| 51 | genesis.hashPrevBlock.SetNull(); |
| 52 | genesis.nHeight = 0; |
| 53 | genesis.hashMerkleRoot = BlockMerkleRoot(genesis); |
| 54 | |
| 55 | return genesis; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Build the genesis block. Note that the output of its generation |
no test coverage detected