Code cleanup
This commit is contained in:
@@ -39,19 +39,20 @@ static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesi
|
||||
// vMerkleTree: 12630d16a9
|
||||
|
||||
CMutableTransaction txNew;
|
||||
txNew.nVersion = 1;
|
||||
txNew.nTime = nTime;
|
||||
txNew.vin.resize(1);
|
||||
txNew.vout.resize(1);
|
||||
txNew.vin[0].scriptSig = CScript() << 0 << CScriptNum(42) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
|
||||
txNew.vout[0].SetEmpty();
|
||||
txNew.vout[0].nValue = genesisReward;
|
||||
|
||||
CBlock genesis;
|
||||
genesis.vtx.push_back(txNew);
|
||||
genesis.hashPrevBlock.SetNull();
|
||||
genesis.nVersion = nVersion;
|
||||
genesis.nTime = nTime;
|
||||
genesis.nBits = nBits;
|
||||
genesis.nNonce = nNonce;
|
||||
genesis.nVersion = nVersion;
|
||||
genesis.vtx.push_back(txNew);
|
||||
genesis.hashPrevBlock.SetNull();
|
||||
genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
|
||||
return genesis;
|
||||
}
|
||||
@@ -130,20 +131,7 @@ public:
|
||||
nMaxTipAge = 24 * 60 * 60;
|
||||
nPruneAfterHeight = 100000;
|
||||
|
||||
const char* pszTimestamp = "20 Feb 2014 Bitcoin ATMs come to USA";
|
||||
CMutableTransaction txNew;
|
||||
txNew.nTime = 1393221600;
|
||||
txNew.vin.resize(1);
|
||||
txNew.vout.resize(1);
|
||||
txNew.vin[0].scriptSig = CScript() << 0 << CScriptNum(42) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
|
||||
txNew.vout[0].SetEmpty();
|
||||
genesis.vtx.push_back(txNew);
|
||||
genesis.hashPrevBlock.SetNull();
|
||||
genesis.nVersion = 1;
|
||||
genesis.nTime = 1393221600;
|
||||
genesis.nBits = 0x1e0fffff;
|
||||
genesis.nNonce = 164482;
|
||||
genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
|
||||
genesis = CreateGenesisBlock(1393221600, 164482, 0x1e0fffff, 1, 0);
|
||||
consensus.hashGenesisBlock = genesis.GetHash();
|
||||
assert(consensus.hashGenesisBlock == uint256S("0x000001faef25dec4fbcf906e6242621df2c183bf232f263d0ba5b101911e4563"));
|
||||
assert(genesis.hashMerkleRoot == uint256S("0x12630d16a97f24b287c8c2594dda5fb98c9e6c70fc61d44191931ea2aa08dc90"));
|
||||
|
||||
Reference in New Issue
Block a user