What happens if a node who is forging blocks gets disconnected from other peers

Hi,

Suppose node A is forging and gets disconnected from other peers. After getting it reconnected, the blocks doesn't update and there is an error saying that the the last common block was #####. What happens in this case when there are duplicate block numbers in the blockchain? The block numbers forged by node A are same as block numbers forged by nodes which were connected to the blockchain at all times. Does this gets resolved automatically?

Also, what if I delete the nxt_db in node A? Does it remove the blocks forged by it so far in the entire blockchain or the new database will restore everything?

Thanks in advance.

It will depend on the time the node is disconnected from the network. If it's just for a while then the node should be able to detect that its blockchain has a lower difficulty and discard it while accepting the better chain from the whole network. All the blocks forged by your node will be discarded.

If it was disconnected for more than 720 blocks, for example, the node won't switch to another chain and you will be on a fork of the network essentially living in a different blockchain.

When the UI detects that your node has forged all the last blocks it will show a warning so you can check if you are on a fork.

It is always safe to stop the node, delete the database (nxt_db folder) and start the node again. The node will then synchronize again and download the entire, correct, blockchain.

1 Like

Thank you Sergi, as always!

1 Like