<p>A node will recalculate the difficulty itself every 2016 blocks, and it does so in a deterministic fashion, based upon the previous 2016 blocks. </p>

<p>So each node will, given the same 2016 previous blocks, arrive at the same result for the new network difficulty. We know that all the nodes will indeed have the same 2016 previous blocks, since the network remains in consensus. </p>

<p>If a node is not well connected to the network, and experiences high latency in receiving new blocks, this would not affect that node's ability to compute the new difficulty, once it receives the new block(s). Until the node receives the 2016th block in that period, it would continue to function just fine, even if it is a block behind the rest of the network. </p>

CC BY-SA 3.0
2018-03-04T21:38:37.907Z
2018-03-04T21:38:37.907Z
chytrik
<p>The target recalculation is not something that is broadcast or something that is announced to nodes. Rather nodes calculate the targets for each block according to a specific algorithm that only requires the blockchain data. It is based on the previous block's target, the block height, and the block timestamps. So each block's target is done completely independently from the network with the only information required being the the blockchain.</p>

<p>Since the algorithm for calculating the target is deterministic, each node will calculate the same difficulty for the same block heights given the same blockchain data.</p>

CC BY-SA 3.0
2018-03-04T21:36:18.663Z
2018-03-04T21:36:18.663Z
Ava Chow
<p>Due to network latencies, some nodes may think they are at a different block height than the rest of the network. How then does a node decide if the target has been recalculated since that changes every 2016 blocks.</p>

<consensus><difficulty-retargetting>
How do nodes reach consensus on when the target is recalculated?
satoshi_ghost
# How do nodes reach consensus on when the target is recalculated?

(Asked by: username_0 on 2018-03-04)

Due to network latencies, some nodes may think they are at a different block height than the rest of the network. How then does a node decide if the target has been recalculated since that changes every 2016 blocks.

**Tags:** consensus, difficulty-retargetting


---

## 2 answers

### Answer by username_1 on 2018-03-04. Score: 1

A node will recalculate the difficulty itself every 2016 blocks, and it does so in a deterministic fashion, based upon the previous 2016 blocks.

So each node will, given the same 2016 previous blocks, arrive at the same result for the new network difficulty. We know that all the nodes will indeed have the same 2016 previous blocks, since the network remains in consensus.

If a node is not well connected to the network, and experiences high latency in receiving new blocks, this would not affect that node's ability to compute the new difficulty, once it receives the new block(s). Until the node receives the 2016th block in that period, it would continue to function just fine, even if it is a block behind the rest of the network.


---

### Answer by username_2 on 2018-03-04. Score: 1

The target recalculation is not something that is broadcast or something that is announced to nodes. Rather nodes calculate the targets for each block according to a specific algorithm that only requires the blockchain data. It is based on the previous block's target, the block height, and the block timestamps. So each block's target is done completely independently from the network with the only information required being the the blockchain.

Since the algorithm for calculating the target is deterministic, each node will calculate the same difficulty for the same block heights given the same blockchain data.


---

