| 43 | } |
| 44 | |
| 45 | static CBlock CreateGenesisBlock(const Consensus::Params& params, const CScript& genesisScriptSig, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward) |
| 46 | { |
| 47 | CMutableTransaction txNew; |
| 48 | txNew.nVersion = 1; |
| 49 | txNew.vin.resize(1); |
| 50 | txNew.vin[0].scriptSig = genesisScriptSig; |
| 51 | txNew.vout.push_back(CTxOut(CAsset(), genesisReward, genesisOutputScript)); |
| 52 | |
| 53 | CBlock genesis; |
| 54 | genesis.nTime = nTime; |
| 55 | genesis.nBits = nBits; |
| 56 | genesis.nNonce = nNonce; |
| 57 | genesis.nVersion = nVersion; |
| 58 | genesis.vtx.push_back(MakeTransactionRef(std::move(txNew))); |
| 59 | genesis.hashPrevBlock.SetNull(); |
| 60 | genesis.hashMerkleRoot = BlockMerkleRoot(genesis); |
| 61 | if (g_signed_blocks) { |
| 62 | genesis.proof = CProof(params.signblockscript, CScript()); |
| 63 | } |
| 64 | return genesis; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Build the genesis block. Note that the output of its generation |
no test coverage detected