<p>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.</p>

CC BY-SA 3.0
2018-02-02T20:09:25.553Z
well 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
CC BY-SA 3.0
2018-02-06T16:03:19.890Z
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
CC BY-SA 3.0
2018-04-07T05:43:52.570Z
how can block 1 be manually created and submitted. i thought of that but when i do getblocktemplate, it tellls me blocks are still downloading
Tim
CC BY-SA 3.0
2018-04-07T14:54:37.043Z
@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
CC BY-SA 4.0
2018-09-13T23:48:22.503Z
@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 message
Tim
CC BY-SA 3.0
2018-02-02T02:01:09.687Z
2018-02-02T02:01:09.687Z
Mine
<p>I have forked PIVX and generated new genesis block hash, merkle root and nonce, and changed the rewards parameters.</p>

<p>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.</p>

<p>My debug.log shows pages and pages of this: </p>

<pre><code>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
</code></pre>

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

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

<p>Thanks!</p>

CC BY-SA 3.0
2018-03-21T07:39:34.340Z
Have you fixed it yet? I think that you have some miss in your configure.
ThanhPT
CC BY-SA 3.0
2018-04-07T02:30:21.527Z
any luck with this i've got the same issue.
Tim
CC BY-SA 4.0
2018-12-10T00:59:16.953Z
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
CC BY-SA 4.0
2018-12-10T01:01:58.837Z
Additionally, I did find a parameter in the `chainparams.cpp` file named `fSkipProofOfWorkCheck` that when set to `true` generates a different error.
Michael Smith
<altcoin><altcoin-development><proof-of-stake><c++>
Forking PIVX - ERROR: CheckBlockHeader() : proof of work failed
Shane Buckley
# Forking PIVX - ERROR: CheckBlockHeader() : proof of work failed

(Asked by: username_0 on 2018-02-01)

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 username_4 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!

**Tags:** altcoin, altcoin-development, proof-of-stake, c++

> **Comments:**
> **username_1**: Have you fixed it yet? I think that you have some miss in your configure.  
> **username_2**: any luck with this i've got the same issue.  
> **username_3**: 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.  
> **username_3**: Additionally, I did find a parameter in the `chainparams.cpp` file named `fSkipProofOfWorkCheck` that when set to `true` generates a different error.  

---

## 1 answers

### Answer by username_4 on 2018-02-02. Score: 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.

> **Comments:**
> **username_0**: well 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 username_4 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..  
> **username_4**: 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.  
> **username_2**: how can block 1 be manually created and submitted. i thought of that but when i do getblocktemplate, it tellls me blocks are still downloading  
> **username_4**: @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.  
> **username_2**: @username_4 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 message  

---

