ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)

1

For study and fun I try to create my own altcoin. I forked Litecoin, removed checkpoints, changed nTime, *pszTimestamp, noNce and hashed new hashes for genesis block in main net, testnet and regressiontest net. The hardcoded assertions goes OK but when I start the deamon

./src/cryptoind 

I get alwais the same result:

ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8) ... ActivateBestChainStep --> Failed!

Going deeper in the code the following statement always fails (main.cpp):

if (UintToArith256(hash) > bnTarget)

Seems like the genesis block does not respect the difficulty (PoW)

Someone faced the same issue? Thank you all

Andrea Pizzirani

Posted 2017-12-31T00:42:04.293

Reputation: 11

I met same problem. Have you solved? How?creator 2018-02-22T05:05:47.697

Answers

1

It seems the -reindex parameter solves the issue.

https://github.com/bitcoin/bitcoin/issues/8081

Bedri Ozgur Guler

Posted 2017-12-31T00:42:04.293

Reputation: 21

Welcome to BitcoinSE! Please note, the original question states that it is a fork of Litecoin.Willtech 2018-02-04T09:04:44.667

Yes but the -reindex parameter still seems to solve the issue. I had made further explanation at https://stackoverflow.com/questions/47828172/encountering-readblockfromdisk-errors-in-block-header-at-cblockdiskposnfile-0/48606397#48606397 I also am trying to create an altcoin and had stuck at the same ERROR message then applying -reindex parameter at least made it work up to a point where I begin to get Error -28 from rpc call which is said to be "Client is still warming up!" (whatever it means) at https://github.com/bitcoin/bitcoin/blob/v0.15.0.1/src/rpc/protocol.h#L32L87.

Bedri Ozgur Guler 2018-02-05T11:30:47.503

Re-Hi to all, i've tried a lot of times with -reindex parameter, but i have the same issue. "ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8) ... ActivateBestChainStep --> Failed!"Andrea Pizzirani 2018-02-06T13:13:59.807

Hello, thx for info. -reindex really take me next step. and now when I run ./xxxcoind -reindex, it seems stop, debug.log says "potential stale tip detected, will try using extra outbound peer", do you know why and solution?creator 2018-02-21T12:06:47.337

So I googled and added [ -connect=0 ] at last. Then again ReadBlockError occured. So I need to maybe actually mine genesis block inside the code. How? And where put that code? At chainparams.cpp's before [ assert(consensus.hashGenesisBlock ] line?creator 2018-02-22T05:51:03.847