Forking PIVX - ERROR: CheckBlockHeader() : proof of work failed

3

3

I have forked PIVX and generated new genesis block hash, merkle root and nonce, and changed the rewards parameters.

It compiles fine and the daemon starts, I have even got 2 nodes connected, but attempting to mine the first block with setgenerate true -1 does not work. getmininginfo says mining = true but the hashratepersec is 0.

My debug.log shows pages and pages of this:

2018-02-01 13:16:55 CreateNewBlock() : TestBlockValidity failed
2018-02-01 13:16:55 CreateNewBlock(): total size 1000
2018-02-01 13:16:55 ERROR: CheckProofOfWork() : hash doesn't match nBits
2018-02-01 13:16:55 ERROR: CheckBlockHeader() : proof of work failed
2018-02-01 13:16:55 ERROR: CheckBlock() : CheckBlockHeader failed
2018-02-01 13:16:55 CreateNewBlock() : TestBlockValidity failed
2018-02-01 13:16:55 CreateNewBlock(): total size 1000
2018-02-01 13:16:55 ERROR: CheckProofOfWork() : hash doesn't match nBits
2018-02-01 13:16:55 ERROR: CheckBlockHeader() : proof of work failed
2018-02-01 13:16:55 ERROR: CheckBlock() : CheckBlockHeader failed
2018-02-01 13:16:55 CreateNewBlock() : TestBlockValidity failed
2018-02-01 13:16:55 CreateNewBlock(): total size 1000
2018-02-01 13:16:55 ERROR: CheckProofOfWork() : hash doesn't match nBits
2018-02-01 13:16:55 ERROR: CheckBlockHeader() : proof of work failed
2018-02-01 13:16:55 ERROR: CheckBlock() : CheckBlockHeader failed
2018-02-01 13:16:55 CreateNewBlock() : TestBlockValidity failed
2018-02-01 13:16:55 CreateNewBlock(): total size 1000
2018-02-01 13:16:55 ERROR: CheckProofOfWork() : hash doesn't match nBits
2018-02-01 13:16:55 ERROR: CheckBlockHeader() : proof of work failed

I think this maybe a small error somewhere but not exactly sure where. Maybe someone would know from experience?

If you are commenting to say "not another coin clone" please save your energy for something more productive.

Thanks!

Shane Buckley

Posted 2018-02-01T13:38:00.133

Reputation: 31

Have you fixed it yet? I think that you have some miss in your configure.ThanhPT 2018-03-21T07:39:34.340

any luck with this i've got the same issue.Tim Baker 2018-04-07T02:30:21.527

I am also trying to clone PIVX. Now I feel the issue may be related to the fact that the PIVX is now PoS only. I am currently looking through the commit history to find any code that may break the PoW functionality.Michael Smith 2018-12-10T00:59:16.953

Additionally, I did find a parameter in the chainparams.cpp file named fSkipProofOfWorkCheck that when set to true generates a different error.Michael Smith 2018-12-10T01:01:58.837

Answers

0

Create the first block manually. I believe that is how Satoshi Nakamoto did it. I think there is a uniqueness to the first block and I've read that it's funds can't be used for some reason.

Mine

Posted 2018-02-01T13:38:00.133

Reputation: 1 142

1well the first block is the genesis block which is block 0 and which I've already gotten the hash for but it won't let me mine block 1 with setgenerate true -1. Even though it compiled fine and even says generate = true but hashpersec is 0 and its still on block 0..Shane Buckley 2018-02-02T20:09:25.553

May want to manually create block 1 and submit to the wallet. That may help identify what part is the issue as it could be the miner or the wallet at this point.Mine 2018-02-06T16:03:19.890

how can block 1 be manually created and submitted. i thought of that but when i do getblocktemplate, it tellls me blocks are still downloadingTim Baker 2018-04-07T05:43:52.570

@TimBaker Manually create the block instead of using a miner and simply start the program with the first block (or block "0") already manually inputted into the database. Pre-existing in the context of running the wallet. Which just means blk0000.dat (or whatever the filename is) already has that first block for the wallet to read from. I think mining should work properly from there.Mine 2018-04-07T14:54:37.043

@mine yeah the issue ended up being with an update a user had pushed which broke the internal miner. I believe i found it in pow.cpp but I got it working now thanks just saw your messageTim Baker 2018-09-13T23:48:22.503