I'm specifically looking for the difficulty retargetting period of Bitcoin Cash, but since it is a fork of Core it should be the same code.


Looks like the answer lies here for bitcoin Cash:

More specifically it is here:

  • Just FYI, when you resolve your own question, it is good to accept your answer. Otherwise it gets "bumped" to the front page again and again because the system does not know whether the answer was satisfactory. – Nate Eldredge Jan 28 '18 at 16:15

Albert's link shows the "emergency difficulty adjustment" code. The basic 2016-block difficulty adjustment is defined in chainparams.cpp:

    consensus.nPowTargetTimespan = 14 * 24 * 60 * 60;

This is the desired time in seconds between difficulty adjustments. You can also see below where they hardcode the corresponding number of blocks:

    consensus.nMinerConfirmationWindow = 2016;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.