Where in the Bitcoin Cash code is the retargetting period defined?

0

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.

Albert s

Posted 2017-08-01T00:28:07.497

Reputation: 1 344

Answers

1

Albert s

Posted 2017-08-01T00:28:07.497

Reputation: 1 344

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 2018-01-28T16:15:27.890

1

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;

Nate Eldredge

Posted 2017-08-01T00:28:07.497

Reputation: 21 420