Author

Topic: Why cant my altcoin regnet create 101 blocks? (Read 138 times)

newbie
Activity: 14
Merit: 0
January 15, 2018, 02:45:38 PM
#1
I have modified bitcoin source code for my altcoin. I have successfully created genesis block, merkel root, noonce and daemon is working well. I have tweaked number of coins per day, total coins etc.. I have also set the bitcoin.conf to server=1, regtest=1 with rpc user and password.

Now i am following the bitcoin CLI tutorial to create first 101 blocks,  but it only creates 1 block instead of one block.

https://bitcoin.org/en/developer-examples#testing-applications

Here is my chainparams.cpp

Code:
/**
 * Regression test
 */
class CRegTestParams : public CChainParams {
public:
    CRegTestParams() {
        strNetworkID = "regtest";
        consensus.nSubsidyHalvingInterval = 150;
        consensus.BIP16Height = 0; // always enforce P2SH BIP16 on regtest
        consensus.BIP34Height = 100000000; // BIP34 has not activated on regtest (far in the future so block v1 are not rejected in tests)
        consensus.BIP34Hash = uint256();
        consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests)
        consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests)
        consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
        consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
        consensus.nPowTargetSpacing = 10 * 60;
        consensus.fPowAllowMinDifficultyBlocks = true;
        consensus.fPowNoRetargeting = true;
        consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
        consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)

and in the commanline, it is executing only one block.
Code:
./bitcoin-cli -regtest generate 101
[
  "179ef1bb855aed3d01324e6eff17ce63773b3ae79a0e123bfdf7f5d11cad0360"
]

and the output (clipped)

Code:
./bitcoin-cli -regtest getblockchaininfo
{
  "chain": "regtest",
  "blocks": 4,
  "headers": 4,
  "bestblockhash": "179ef1bb855aed3d01324e6eff17ce63773b3ae79a0e123bfdf7f5d11cad0360",
  "difficulty": 4.656542373906925e-10,
  "mediantime": 1516037681,
  "verificationprogress": 1,
  "initialblockdownload": false,
  "chainwork": "0000000000000000000000000000000000000000000000000000000100010009",
  "size_on_disk": 1551,
  "pruned": false,
  "softforks": [
    {
      "id": "bip34",
      "version": 2,
      "reject": {
        "status": false
      }

What is preventing creating 101 blocks?

Jump to: