<p>Looks like the answer lies here for bitcoin Cash:<br>
<a href="https://reviews.bitcoinabc.org/rABC7ad1105f43d7bff158d4b5c882ab9bf1b74d6cce" rel="nofollow noreferrer">https://reviews.bitcoinabc.org/rABC7ad1105f43d7bff158d4b5c882ab9bf1b74d6cce</a>   </p>

<p>More specifically it is here:<br>
<a href="https://github.com/Bitcoin-ABC/bitcoin-abc/blob/master/src/pow.cpp#L73" rel="nofollow noreferrer">https://github.com/Bitcoin-ABC/bitcoin-abc/blob/master/src/pow.cpp#L73</a></p>

CC BY-SA 3.0
2018-01-28T16:15:27.890Z
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
CC BY-SA 3.0
2017-08-01T01:05:54.710Z
2017-08-01T01:05:54.710Z
Albert S
<p>Albert's link shows the "emergency difficulty adjustment" code.  The basic 2016-block difficulty adjustment is defined in <a href="https://github.com/Bitcoin-ABC/bitcoin-abc/blob/8a4cecc3763cb194a494385b45428f1736082d52/src/chainparams.cpp#L108" rel="nofollow noreferrer"><code>chainparams.cpp</code></a>:</p>

<pre><code>    consensus.nPowTargetTimespan = 14 * 24 * 60 * 60;
</code></pre>

<p>This is the desired time in seconds between difficulty adjustments.  You can also see <a href="https://github.com/Bitcoin-ABC/bitcoin-abc/blob/8a4cecc3763cb194a494385b45428f1736082d52/src/chainparams.cpp#L115" rel="nofollow noreferrer">below</a> where they hardcode the corresponding number of blocks:</p>

<pre><code>    consensus.nMinerConfirmationWindow = 2016;
</code></pre>

CC BY-SA 3.0
2018-01-28T16:14:06.967Z
2018-01-28T16:14:06.967Z
Nate Eldredge
<p>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.</p>

<bitcoin-core><difficulty><bitcoin-cash><ecash><difficulty-retargetting>
Where in the Bitcoin Cash code is the retargetting period defined?
Albert S
# Where in the Bitcoin Cash code is the retargetting period defined?

(Asked by: username_0 on 2017-08-01)

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.

**Tags:** bitcoin-core, difficulty, bitcoin-cash, ecash, difficulty-retargetting


---

## 2 answers

### Answer by username_0 on 2017-08-01. Score: 1 | Accepted answer

Looks like the answer lies here for bitcoin Cash:  
<https://reviews.bitcoinabc.org/rABC7ad1105f43d7bff158d4b5c882ab9bf1b74d6cce>

More specifically it is here:  
<https://github.com/Bitcoin-ABC/bitcoin-abc/blob/master/src/pow.cpp#L73>

> **Comments:**
> **username_1**: 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.  

---

### Answer by username_1 on 2018-01-28. Score: 1

username_0's link shows the "emergency difficulty adjustment" code. The basic 2016-block difficulty adjustment is defined in [`chainparams.cpp`](https://github.com/Bitcoin-ABC/bitcoin-abc/blob/8a4cecc3763cb194a494385b45428f1736082d52/src/chainparams.cpp#L108):

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

```

This is the desired time in seconds between difficulty adjustments. You can also see [below](https://github.com/Bitcoin-ABC/bitcoin-abc/blob/8a4cecc3763cb194a494385b45428f1736082d52/src/chainparams.cpp#L115) where they hardcode the corresponding number of blocks:

```
    consensus.nMinerConfirmationWindow = 2016;

```


---

