<p>This phenomenon is known as a chain-split (i.e. the bitcoin network can no longer agree which chain is the canonical chain).</p>

<p>Nodes will be network-partitioned until one chain becomes dominant.</p>

<p>Therefore:</p>

<blockquote>
  <p>Is the information of the length and accumulated difficulty broadcasted along with mined block?</p>
</blockquote>

<p>No. </p>

<blockquote>
  <p>How will the recipient node handle this situation?</p>
</blockquote>

<p>Nodes will handle equal branches on a First Come, First Serve basis, so there will be a network partition where some nodes agree chain A with length N+4 is the canonical chain and the other set of nodes will assume chain B with length N+4 is the canonical chain. In the event of such a chain-split, the race is on for miners to produce a new block-tip and broadcast it across the bitcoin network ASAP to achieve convergence. When the contention is resolved, the node can switch to longer branch and obsolete the old branch.</p>

CC BY-SA 3.0
2017-10-22T13:15:36.070Z
But then, if I recieve a block that is not for the tip of my blockchain, I will reject it immediately if along I don't recieve the information that it is for the tip of some other heavier chain. I will then never switch to another chain.
croraf
CC BY-SA 3.0
2017-10-22T13:17:52.900Z
Sure, but say you have adopted chain A with length N+4, and suddenly you receive a block-tip of length N+5 that mines on top of chain B, your node will immediately recognise that the block-tip you just received may belong to a longer & heavier chain, so your node will probe the peer that has sent your that block tip for all the relevant blocks.
rny
CC BY-SA 3.0
2017-10-22T13:18:54.323Z
How will my node immediately recognise it was a block for the heavier chain, and not some erroneous block for example?
croraf
CC BY-SA 3.0
2017-10-22T13:22:10.837Z
But I dont know if proof of work is correct as it was made with different inputs (unknown to me).
croraf
CC BY-SA 3.0
2017-10-22T13:29:17.670Z
So I looked the bitcoin core implementation and it looks like all blocks are stored so as long as they obey consensus rules. And there's a function in src/validation.cpp that activates the best chain.
rny
CC BY-SA 3.0
2017-10-22T13:31:40.733Z
So all the blocks from all the branches from entire history of blockchain are stored? You can also join the chat: https://chat.stackexchange.com/rooms/67464/discussion-between-croraf-and-tushar
croraf
CC BY-SA 3.0
2017-10-22T13:10:16.117Z
2017-10-22T14:43:05.573Z
2017-10-22T14:43:05.573Z
rny
<p>Let's say node is on a chain of length N+4, and receives a block from the chain of the same length N+4, but diverged by 4 blocks.</p>

<ol>
<li><p>Is the information of the length and accumulated difficulty broadcasted along with mined block?</p></li>
<li><p>How will the recipient node handle this situation?</p></li>
</ol>

<blockchain><nodes>
How will node handle two branches of same length?
croraf
# How will node handle two branches of same length?

(Asked by: username_0 on 2017-10-22)

Let's say node is on a chain of length N+4, and receives a block from the chain of the same length N+4, but diverged by 4 blocks.

1. Is the information of the length and accumulated difficulty broadcasted along with mined block?
2. How will the recipient node handle this situation?

**Tags:** blockchain, nodes


---

## 1 answers

### Answer by username_1 on 2017-10-22. Score: 3 | Accepted answer

This phenomenon is known as a chain-split (i.e. the bitcoin network can no longer agree which chain is the canonical chain).

Nodes will be network-partitioned until one chain becomes dominant.

Therefore:

> Is the information of the length and accumulated difficulty broadcasted along with mined block?

No.

> How will the recipient node handle this situation?

Nodes will handle equal branches on a First Come, First Serve basis, so there will be a network partition where some nodes agree chain A with length N+4 is the canonical chain and the other set of nodes will assume chain B with length N+4 is the canonical chain. In the event of such a chain-split, the race is on for miners to produce a new block-tip and broadcast it across the bitcoin network ASAP to achieve convergence. When the contention is resolved, the node can switch to longer branch and obsolete the old branch.

> **Comments:**
> **username_0**: But then, if I recieve a block that is not for the tip of my blockchain, I will reject it immediately if along I don't recieve the information that it is for the tip of some other heavier chain. I will then never switch to another chain.  
> **username_1**: Sure, but say you have adopted chain A with length N+4, and suddenly you receive a block-tip of length N+5 that mines on top of chain B, your node will immediately recognise that the block-tip you just received may belong to a longer & heavier chain, so your node will probe the peer that has sent your that block tip for all the relevant blocks.  
> **username_0**: How will my node immediately recognise it was a block for the heavier chain, and not some erroneous block for example?  
> **username_0**: But I dont know if proof of work is correct as it was made with different inputs (unknown to me).  
> **username_1**: So I looked the bitcoin core implementation and it looks like all blocks are stored so as long as they obey consensus rules. And there's a function in src/validation.cpp that activates the best chain.  
> **username_0**: So all the blocks from all the branches from entire history of blockchain are stored? You can also join the chat: https://chat.stackexchange.com/rooms/67464/discussion-between-username_0-and-tushar  

---

