user62759: I am trying to create my own genesis block using the bitcoin source code but my new hashes are not being accepted by the assert statements.
Step 1: 
I have changed the pszTimestamp variable in chainparams.cpp to generate my own genesis hash.
I have added into the code some print statements to check the genesis hash and merkle root as they are generated from my new pszTimestamp. 
The hashes I have generated are:
MERKLE ROOT:9f46bcd8a56be2b6b022acbcc859b201534c21801b1b73685a69de17ad37665e
GENESIS HASH:cc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648
Step 2:
I have changed the assert statements below to assert the new hashes on line 131 and line 230 of chainparams.cpp
The Genesis Block
assert(consensus.hashGenesisBlock==uint256S("0xcc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648"));
The Merkle Root
assert(genesis.hashMerkleRoot==int256S("0x9f46bcd8a56be2b6b022acbcc859b201534c1801b1b73685a69de17ad37665e"));
However...
These assert statements still fail. Why?
I have included the error message below:
bitcoin-qt: chainparams.cpp:230: CTestNetParams::CTestNetParams(): Assertion `consensus.hashGenesisBlock == uint256S("0xcc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648")' failed.
Aborted (core dumped)

user48884: The problem is that you changed the testnet parameters too, not just the mainnet parameters. However I doubt that you regenerated the testnet genesis block, or if you did, you did not set the assert correctly. You set the assert in the testnet chain parameters to be the mainnet genesis block hash and merkle root. But that is obviously wrong; testnet is not the same as mainnet. To fix this, you should either revert the change, or generate a new testnet genesis block and set those asserts accordingly.

62759: <h3>I am trying to create my own genesis block using the bitcoin source code but my new hashes are not being accepted by the assert statements.</h3>

<p><strong><em>Step 1:</em></strong> </p>

<p>I have changed the <code>pszTimestamp</code> variable in <code>chainparams.cpp</code> to generate my own genesis hash.</p>

<p>I have added into the code some print statements to check the genesis hash and merkle root as they are generated from my new <code>pszTimestamp</code>. </p>

<p>The hashes I have generated are:</p>

<p><em>MERKLE ROOT</em>:<code>9f46bcd8a56be2b6b022acbcc859b201534c21801b1b73685a69de17ad37665e</code></p>

<p><em>GENESIS HASH:</em><code>cc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648</code></p>

<p><strong><em>Step 2:</em></strong></p>

<p>I have changed the <code>assert</code> statements below to assert the new hashes on <code>line 131</code> and <code>line 230</code> of <code>chainparams.cpp</code></p>

<p><strong>The Genesis Block</strong> 
<code>assert(consensus.hashGenesisBlock==uint256S("0xcc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648"));</code></p>

<p><strong>The Merkle Root</strong> 
<code>assert(genesis.hashMerkleRoot==int256S("0x9f46bcd8a56be2b6b022acbcc859b201534c1801b1b73685a69de17ad37665e"));</code></p>

<h3>However...</h3>

<p>These assert statements still fail. <strong>Why?</strong></p>

<p>I have included the error message below:</p>

<p><code>bitcoin-qt: chainparams.cpp:230: CTestNetParams::CTestNetParams(): Assertion `consensus.hashGenesisBlock == uint256S("0xcc45935bfeb12faacc8ab2797d2f5507f7eef8a44c597f3622c704cc0af8a648")' failed.
Aborted (core dumped)</code></p>
 48884: <p>The problem is that you changed the testnet parameters too, not just the mainnet parameters. However I doubt that you regenerated the testnet genesis block, or if you did, you did not set the assert correctly. You set the assert in the testnet chain parameters to be the mainnet genesis block hash and merkle root. But that is obviously wrong; testnet is not the same as mainnet. To fix this, you should either revert the change, or generate a new testnet genesis block and set those asserts accordingly.</p>
