<p>Peers of the node will tell the node the height of their longest blockchain, and if this is greater than what the node currently has stored, it will request the missing blocks from that node (to validate and store them). Also, if a node is on the network and receives a new block, it will look at the hash of its parent and decide if it has the parent already or not. If it doesn't have the parent, it will ask its peers for it. That way it will eventually download all the blocks it is missing and be up to date again</p>

<p>The node will keep track of how long each fork of the blockchain is, and will use the longest one it finds which it considers valid. If a long fork appears which the node thinks is not valid, it will show a warning that either the node is out of date or the peers are.</p>

CC BY-SA 3.0
2017-07-15T03:07:59.587Z
Great explanation! Thanks! Could you explain more by your last sentence?
rb612
CC BY-SA 3.0
2017-07-15T07:22:30.077Z
If a chain looks invalid to a node, but its pretty long, it'll wonder why the network keeps extending it, because the network should drop invalid blocks. So if it is above a certain length, the node will give a warning to the user, because the most likely reason is a hardfork which requires a client software upgrade
meshcollider
CC BY-SA 3.0
2017-07-15T02:27:57.270Z
2017-07-15T02:27:57.270Z
meshcollider
<p>If a bitcoin client goes offline or misses a new block, what is the process of finding the current, main blockchain? And how does bitcoin ensure that updates to the blockchain will be propogated to each device connected to the network (i.e. to make sure connected nodes never have a missed block in the ledger?) Does it somehow recursively backtrack from the next broadcasted block's reference to the previous block? And then how does it ensure that the current chain broadcasted is an addition to the main chain, rather than some fork? For example, if the client connects to the network and receives a block of given height, how does it both know that it has the most work of any chain, and that the local copy contains all blocks in the chain?</p>

CC BY-SA 3.0
2017-07-14T08:03:10.787Z
have a look here: https://www.transifex.com/bitcoinbook/mastering-bitcoin/languages/ Andreas book "Mastering Bitcoin" has already been translated into many languages, and serves as a very good start into the matter. There is also an online (english) version of the book. The answer(s) to your many questions would bee too much... This forum is intended to raise simple questions, one by one ...
pebwindkraft
CC BY-SA 3.0
2017-07-14T21:03:45.510Z
@pebwindkraft thanks for the resource! I'm really wondering just the general process of how clients get new blocks after downtime. Everything else is surrounding that concept. I couldn't really find anything else online that answers how the client gets changes to the main block chain.
rb612
<transactions><blockchain><client><block>
How do bitcoin clients update after downtime?
rb612
# How do bitcoin clients update after downtime?

(Asked by: username_0 on 2017-07-14)

If a bitcoin client goes offline or misses a new block, what is the process of finding the current, main blockchain? And how does bitcoin ensure that updates to the blockchain will be propogated to each device connected to the network (i.e. to make sure connected nodes never have a missed block in the ledger?) Does it somehow recursively backtrack from the next broadcasted block's reference to the previous block? And then how does it ensure that the current chain broadcasted is an addition to the main chain, rather than some fork? For example, if the client connects to the network and receives a block of given height, how does it both know that it has the most work of any chain, and that the local copy contains all blocks in the chain?

**Tags:** transactions, blockchain, client, block

> **Comments:**
> **username_1**: have a look here: https://www.transifex.com/bitcoinbook/mastering-bitcoin/languages/ Andreas book "Mastering Bitcoin" has already been translated into many languages, and serves as a very good start into the matter. There is also an online (english) version of the book. The answer(s) to your many questions would bee too much... This forum is intended to raise simple questions, one by one ...  
> **username_0**: @username_1 thanks for the resource! I'm really wondering just the general process of how clients get new blocks after downtime. Everything else is surrounding that concept. I couldn't really find anything else online that answers how the client gets changes to the main block chain.  

---

## 1 answers

### Answer by username_2 on 2017-07-15. Score: 1 | Accepted answer

Peers of the node will tell the node the height of their longest blockchain, and if this is greater than what the node currently has stored, it will request the missing blocks from that node (to validate and store them). Also, if a node is on the network and receives a new block, it will look at the hash of its parent and decide if it has the parent already or not. If it doesn't have the parent, it will ask its peers for it. That way it will eventually download all the blocks it is missing and be up to date again

The node will keep track of how long each fork of the blockchain is, and will use the longest one it finds which it considers valid. If a long fork appears which the node thinks is not valid, it will show a warning that either the node is out of date or the peers are.

> **Comments:**
> **username_0**: Great explanation! Thanks! Could you explain more by your last sentence?  
> **username_2**: If a chain looks invalid to a node, but its pretty long, it'll wonder why the network keeps extending it, because the network should drop invalid blocks. So if it is above a certain length, the node will give a warning to the user, because the most likely reason is a hardfork which requires a client software upgrade  

---

