MCPcopy Create free account
hub / github.com/ElementsProject/elements / CreateGenesisBlock

Function CreateGenesisBlock

src/chainparams.cpp:45–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45static 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

Callers 7

CMainParamsMethod · 0.85
CTestNetParamsMethod · 0.85
SigNetParamsMethod · 0.85
CRegTestParamsMethod · 0.85
SetGenesisBlockMethod · 0.85
CLiquidV1ParamsMethod · 0.85
SetGenesisBlockMethod · 0.85

Calls 11

CAssetClass · 0.85
BlockMerkleRootFunction · 0.85
ParseHexFunction · 0.85
CProofClass · 0.70
CScriptClass · 0.70
CTxOutClass · 0.50
MakeTransactionRefFunction · 0.50
CScriptNumClass · 0.50
resizeMethod · 0.45
push_backMethod · 0.45
SetNullMethod · 0.45

Tested by

no test coverage detected