1
I am simulating a private bitcoin network that I started with the initial difficulty set to (1/2)^16, however after about 20 blocks of mining on the network it increased to 1 and has been constant since then. As far as I understand from the source code, it is supposed to increase after every 2016 blocks, so how did it increase after only 20 blocks.
Change of powLimit in my bitcoind instances.
strNetworkID = "regtest";
consensus.nSubsidyHalvingInterval = 210000;
consensus.nMajorityEnforceBlockUpgrade = 51;
consensus.nMajorityRejectBlockOutdated = 75;
consensus.nMajorityWindow = 100;
consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
consensus.nPowTargetSpacing = 10 * 60;
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = false;
Are you sure it didn't say difficulty 1 all along? On Bitcoin mainnet, difficulty is equal to the maximum (least difficult) target divided by the current target; if you set your minimum target to x and it's still at x, then that would also be a relative difficulty of 1. – David A. Harding – 2015-11-02T17:13:57.407
@DavidA.Harding yeah I figured that out later from the bitcoin documentation. Thanks. – bawejakunal – 2015-11-03T03:04:54.797
Cool. Turned it into an answer. – David A. Harding – 2015-11-03T04:01:34.423