<p>Try deleting the block files. That error signals that the proof of work on the loaded block is incorrect.</p>

CC BY-SA 3.0
2017-08-02T14:54:45.410Z
I tried deleting the entire bitcoin folder from ~/Library/Application\ Support/ before trying to run this. still go the same error
Kannan Ravindran
CC BY-SA 3.0
2017-08-02T16:07:47.670Z
Did you change any of the proof of work code?
Nick ODell
CC BY-SA 3.0
2017-08-02T16:25:06.800Z
Nope, Just the things that I mentioned above.
  - pszTimestamp
  - nTime
  - nNounce
  - consensus.hashGenesisBlock
  - genesis.hashMerkleRoot
Kannan Ravindran
CC BY-SA 3.0
2017-08-02T16:36:58.440Z
Does the new block have enough proof of work?
Nick ODell
CC BY-SA 3.0
2017-08-02T16:55:41.760Z
I haven't started mining (or instamining) even the inital blocks that needs to be hardcoded as checkpointData in chainparams.cpp if thats what you are asking!
Kannan Ravindran
CC BY-SA 3.0
2017-08-02T16:56:20.043Z
No, I'm asking if your genesis block has enough proof of work. How many zeros does the block hash start with?
Nick ODell
CC BY-SA 3.0
2017-08-02T16:58:35.300Z
no zeros. `0xc9b9f1fec2c0d161183f01e781a390f56d251b359ee07933bc2ac7bc009a1726`
Kannan Ravindran
CC BY-SA 3.0
2017-08-02T16:59:27.253Z
Try using a genesis block with enough PoW.
Nick ODell
CC BY-SA 3.0
2017-08-02T17:20:10.993Z
How do I achieve that? I was trying to use this to generate a genesis block. https://github.com/lhartikk/GenesisH0
Kannan Ravindran
CC BY-SA 3.0
2017-08-02T17:20:59.403Z
Yeah, that program looks like it would work.
Nick ODell
CC BY-SA 3.0
2017-08-02T22:50:34.927Z
I tried a couple of different Genesis blocks but was unsuccessful in getting a hash with a lot of preceding zeros. Also, I was thinking there could be some other reason too since the litecoin's code doesn't have such a hash in their code!
[litecoin's genesis hash](https://github.com/litecoin-project/litecoin/blob/master/src/chainparams.cpp#L119)
Kannan Ravindran
CC BY-SA 3.0
2017-08-01T21:41:56.200Z
2017-08-01T21:41:56.200Z
Nick ODell
<p>Also check checkpoints, maybe this will help!</p>

CC BY-SA 3.0
2017-08-02T16:34:44.163Z
by checkpoints, do you mean the checkpoints.cpp ?
Kannan Ravindran
CC BY-SA 3.0
2017-08-03T22:05:08.367Z
yeah, depends on code version, also checkpoints in chainparams.cpp
 IT Tech 
CC BY-SA 3.0
2017-08-01T23:14:27.627Z
2017-08-01T23:14:27.627Z
 IT Tech 
<p>I was trying to clone the bitcoin's source code and run a completely new blockchain. I was successful in changing the initial parameters such as</p>

<ul>
<li>pszTimestamp</li>
<li>nTime</li>
<li>nNounce</li>
</ul>

<p>Generated a genesis block and replaced the hardcoded values of </p>

<ul>
<li>consensus.hashGenesisBlock</li>
<li>genesis.hashMerkleRoot</li>
</ul>

<p>The above steps successfully generated the genesis block. But after then the bitcoin core is trying to load the checkpoints( I think so) from disk and results in error. </p>

<pre><code>2017-07-31 21:06:42 Bitcoin version v0.14.99.0-42307c4bf-dirty
2017-07-31 21:06:42 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -&gt; setting -whitelistrelay=1
2017-07-31 21:06:42 Assuming ancestors of block 0000000000000000003b9ce759c2a087d52abc4266f8f4ebd6d768b89defa50a have valid signatures.
2017-07-31 21:06:42 Using the 'standard' SHA256 implementation
2017-07-31 21:06:42 Using RdRand as an additional entropy source
2017-07-31 21:06:42 Default data directory /Users/username/Library/Application Support/Bitcoin
2017-07-31 21:06:42 Using data directory /Users/username/Library/Application Support/Bitcoin
2017-07-31 21:06:42 Using config file /Users/username/Library/Application Support/Bitcoin/bitcoin.conf
2017-07-31 21:06:42 Using at most 125 automatic connections (4864 file descriptors available)
2017-07-31 21:06:42 Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2017-07-31 21:06:42 Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2017-07-31 21:06:42 Using 2 threads for script verification
2017-07-31 21:06:42 scheduler thread start
2017-07-31 21:06:42 HTTP: creating work queue of depth 16
2017-07-31 21:06:42 No rpcpassword set - using random cookie authentication
2017-07-31 21:06:42 Generated RPC authentication cookie /Users/username/Library/Application Support/Bitcoin/.cookie
2017-07-31 21:06:42 HTTP: starting 4 worker threads
2017-07-31 21:06:42 init message: Verifying wallet(s)...
2017-07-31 21:06:42 Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2017-07-31 21:06:42 Using wallet wallet.dat
2017-07-31 21:06:42 CDBEnv::Open: LogDir=/Users/username/Library/Application Support/Bitcoin/database ErrorFile=/Users/username/Library/Application Support/Bitcoin/db.log
2017-07-31 21:06:42 Cache configuration:
2017-07-31 21:06:42 * Using 2.0MiB for block index database
2017-07-31 21:06:42 * Using 8.0MiB for chain state database
2017-07-31 21:06:42 * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2017-07-31 21:06:42 init message: Loading block index...
2017-07-31 21:06:42 Opening LevelDB in /Users/username/Library/Application Support/Bitcoin/blocks/index
2017-07-31 21:06:42 Opened LevelDB successfully
2017-07-31 21:06:42 Using obfuscation key for /Users/username/Library/Application Support/Bitcoin/blocks/index: 0000000000000000
2017-07-31 21:06:42 Opening LevelDB in /Users/username/Library/Application Support/Bitcoin/chainstate
2017-07-31 21:06:42 Opened LevelDB successfully
2017-07-31 21:06:42 Using obfuscation key for /Users/username/Library/Application Support/Bitcoin/chainstate: 7bbd099730c6ddd0
2017-07-31 21:06:42 LoadBlockIndexDB: last block file = 0
2017-07-31 21:06:42 LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
2017-07-31 21:06:42 Checking all blk files are present...
2017-07-31 21:06:42 LoadBlockIndexDB: transaction index disabled
2017-07-31 21:06:42 Initializing databases...
2017-07-31 21:06:42 Pre-allocating up to position 0x1000000 in blk00000.dat
2017-07-31 21:06:42 init message: Verifying blocks...
2017-07-31 21:06:42  block index             208ms
2017-07-31 21:06:42 init message: Loading wallet...
2017-07-31 21:06:42 nFileVersion = 149900
2017-07-31 21:06:42 Keys: 2001 plaintext, 0 encrypted, 2001 w/ metadata, 2001 total
2017-07-31 21:06:42  wallet                  127ms
2017-07-31 21:06:42 setKeyPool.size() = 1999
2017-07-31 21:06:42 mapWallet.size() = 0
2017-07-31 21:06:42 mapAddressBook.size() = 1
2017-07-31 21:06:42 ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)
2017-07-31 21:06:42 *** Failed to read block
2017-07-31 21:06:42 Error: Error: A fatal internal error occurred, see debug.log for details
</code></pre>

<p>There was a thread explaining how to block the code from checking for checkpoints. <a href="https://bitcointalk.org/index.php?topic=225690.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=225690.0</a> But the thread is outdated and the code has gone through a lot of changes.</p>

<p>I need some help solving the error and proceeding to instamine the first few block and hardcode them too in the code.</p>

CC BY-SA 3.0
2017-09-01T03:42:56.553Z
The first thing to do when you have a segfault is to use your debugger to get a backtrace and inspect the values of relevant variables - have you done that?
Nate Eldredge
CC BY-SA 3.0
2017-10-03T23:19:14.960Z
i am getting the same exact error. were you able to solve it?
subodh1989
CC BY-SA 3.0
2017-10-04T16:09:10.573Z
@subodh1989 unfortunately, no. To achieve it with the forum link I provided. We need to rollback literally everything from git version till openssl version. Then it may work.
Kannan Ravindran
CC BY-SA 3.0
2017-10-05T01:18:20.177Z
i solved this issue. check my question and answer.
subodh1989
<development><altcoin-development>
Segmentation fault when loading checkpoints - altcoin dev
Kannan Ravindran
# Segmentation fault when loading checkpoints - altcoin dev

(Asked by: username_0 on 2017-08-01)

I was trying to clone the bitcoin's source code and run a completely new blockchain. I was successful in changing the initial parameters such as

pszTimestamp
nTime
nNounce

Generated a genesis block and replaced the hardcoded values of 

consensus.hashGenesisBlock
genesis.hashMerkleRoot

The above steps successfully generated the genesis block. But after then the bitcoin core is trying to load the checkpoints( I think so) from disk and results in error. 
2017-07-31 21:06:42 Bitcoin version v0.14.99.0-42307c4bf-dirty
2017-07-31 21:06:42 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2017-07-31 21:06:42 Assuming ancestors of block 0000000000000000003b9ce759c2a087d52abc4266f8f4ebd6d768b89defa50a have valid signatures.
2017-07-31 21:06:42 Using the 'standard' SHA256 implementation
2017-07-31 21:06:42 Using RdRand as an additional entropy source
2017-07-31 21:06:42 Default data directory /Users/username/Library/Application Support/Bitcoin
2017-07-31 21:06:42 Using data directory /Users/username/Library/Application Support/Bitcoin
2017-07-31 21:06:42 Using config file /Users/username/Library/Application Support/Bitcoin/bitcoin.conf
2017-07-31 21:06:42 Using at most 125 automatic connections (4864 file descriptors available)
2017-07-31 21:06:42 Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2017-07-31 21:06:42 Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2017-07-31 21:06:42 Using 2 threads for script verification
2017-07-31 21:06:42 scheduler thread start
2017-07-31 21:06:42 HTTP: creating work queue of depth 16
2017-07-31 21:06:42 No rpcpassword set - using random cookie authentication
2017-07-31 21:06:42 Generated RPC authentication cookie /Users/username/Library/Application Support/Bitcoin/.cookie
2017-07-31 21:06:42 HTTP: starting 4 worker threads
2017-07-31 21:06:42 init message: Verifying wallet(s)...
2017-07-31 21:06:42 Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2017-07-31 21:06:42 Using wallet wallet.dat
2017-07-31 21:06:42 CDBEnv::Open: LogDir=/Users/username/Library/Application Support/Bitcoin/database ErrorFile=/Users/username/Library/Application Support/Bitcoin/db.log
2017-07-31 21:06:42 Cache configuration:
2017-07-31 21:06:42 * Using 2.0MiB for block index database
2017-07-31 21:06:42 * Using 8.0MiB for chain state database
2017-07-31 21:06:42 * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2017-07-31 21:06:42 init message: Loading block index...
2017-07-31 21:06:42 Opening LevelDB in /Users/username/Library/Application Support/Bitcoin/blocks/index
2017-07-31 21:06:42 Opened LevelDB successfully
2017-07-31 21:06:42 Using obfuscation key for /Users/username/Library/Application Support/Bitcoin/blocks/index: 0000000000000000
2017-07-31 21:06:42 Opening LevelDB in /Users/username/Library/Application Support/Bitcoin/chainstate
2017-07-31 21:06:42 Opened LevelDB successfully
2017-07-31 21:06:42 Using obfuscation key for /Users/username/Library/Application Support/Bitcoin/chainstate: 7bbd099730c6ddd0
2017-07-31 21:06:42 LoadBlockIndexDB: last block file = 0
2017-07-31 21:06:42 LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
2017-07-31 21:06:42 Checking all blk files are present...
2017-07-31 21:06:42 LoadBlockIndexDB: transaction index disabled
2017-07-31 21:06:42 Initializing databases...
2017-07-31 21:06:42 Pre-allocating up to position 0x1000000 in blk00000.dat
2017-07-31 21:06:42 init message: Verifying blocks...
2017-07-31 21:06:42  block index             208ms
2017-07-31 21:06:42 init message: Loading wallet...
2017-07-31 21:06:42 nFileVersion = 149900
2017-07-31 21:06:42 Keys: 2001 plaintext, 0 encrypted, 2001 w/ metadata, 2001 total
2017-07-31 21:06:42  wallet                  127ms
2017-07-31 21:06:42 setKeyPool.size() = 1999
2017-07-31 21:06:42 mapWallet.size() = 0
2017-07-31 21:06:42 mapAddressBook.size() = 1
2017-07-31 21:06:42 ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)
2017-07-31 21:06:42 *** Failed to read block
2017-07-31 21:06:42 Error: Error: A fatal internal error occurred, see debug.log for details

There was a thread explaining how to block the code from checking for checkpoints. https://bitcointalk.org/index.php?topic=225690.0 But the thread is outdated and the code has gone through a lot of changes.
I need some help solving the error and proceeding to instamine the first few block and hardcode them too in the code.

**Tags:** development, altcoin-development

> **Comments:**
> **username_1**: The first thing to do when you have a segfault is to use your debugger to get a backtrace and inspect the values of relevant variables - have you done that?  
> **username_2**: i am getting the same exact error. were you able to solve it?  
> **username_0**: @username_2 unfortunately, no. To achieve it with the forum link I provided. We need to rollback literally everything from git version till openssl version. Then it may work.  
> **username_2**: i solved this issue. check my question and answer.  

---

## 2 answers

### Answer by username_3 on 2017-08-01. Score: 1

Try deleting the block files. That error signals that the proof of work on the loaded block is incorrect.

> **Comments:**
> **username_0**: I tried deleting the entire bitcoin folder from ~/Library/Application\ Support/ before trying to run this. still go the same error  
> **username_3**: Did you change any of the proof of work code?  
> **username_0**: Nope, Just the things that I mentioned above.   - pszTimestamp   - nTime   - nNounce   - consensus.hashGenesisBlock   - genesis.hashMerkleRoot  
> **username_3**: Does the new block have enough proof of work?  
> **username_0**: I haven't started mining (or instamining) even the inital blocks that needs to be hardcoded as checkpointData in chainparams.cpp if thats what you are asking!  
> **username_3**: No, I'm asking if your genesis block has enough proof of work. How many zeros does the block hash start with?  
> **username_0**: no zeros. `0xc9b9f1fec2c0d161183f01e781a390f56d251b359ee07933bc2ac7bc009a1726`  
> **username_3**: Try using a genesis block with enough PoW.  
> **username_0**: How do I achieve that? I was trying to use this to generate a genesis block. https://github.com/lhartikk/GenesisH0  
> **username_3**: Yeah, that program looks like it would work.  
> **username_0**: I tried a couple of different Genesis blocks but was unsuccessful in getting a hash with a lot of preceding zeros. Also, I was thinking there could be some other reason too since the litecoin's code doesn't have such a hash in their code! [litecoin's genesis hash](https://github.com/litecoin-project/litecoin/blob/master/src/chainparams.cpp#L119)  

---

### Answer by username_4 on 2017-08-01. Score: 0

Also check checkpoints, maybe this will help!

> **Comments:**
> **username_0**: by checkpoints, do you mean the checkpoints.cpp ?  
> **username_4**: yeah, depends on code version, also checkpoints in chainparams.cpp  

---

