<p>Solution found! <br>
Bitcoin client use checkpoints to prevent 51% attack. <a href="https://bitcoin.stackexchange.com/questions/1797/what-are-checkpoints">What are checkpoints?</a><br></p>

<p>Modifying checkpoints in chainparams.cpp solve this sync problem.</p>

CC BY-SA 3.0
2015-04-06T14:47:25.690Z
2015-04-06T14:47:25.690Z
2017-04-13T12:47:33.660Z
moshaholo
<p>I created two altcoin peers and they can add blocks to genesis block. However their blockchains do not sync with each other!</p>

<p>The only way let the block merge is to stop a peer and restart the peer. </p>

<p>Is there any solution? Thanks..</p>

CC BY-SA 3.0
2015-03-20T04:13:13.200Z
Are the two peers connected to each other? Do they have any way of finding out about each other? If not, have you tried adding your own DNS seed in chainparams.cpp, or using the -addnode option?
Nick ODell
CC BY-SA 3.0
2015-03-20T13:16:16.160Z
I tested it using two local virtual machines. These two VMware can ping with each other.  Also, I tried using -addnode option..
moshaholo
CC BY-SA 3.0
2015-03-20T19:24:40.927Z
Are they actually connected, though? Does debug.log show successful connections, or does wireshark show traffic on port 9333?
Nick ODell
CC BY-SA 3.0
2015-03-20T19:47:22.153Z
@NickODell Yes, they are connected. Bitcoin-cli getpeerinfo show my connected peer.. The peer on one vm is 172.28.128.4:33787, the peer on another vm is 172.28.128.3.
moshaholo
CC BY-SA 3.0
2015-03-23T04:43:14.207Z
How fast is each node mining blocks? If each is mining blocks fast enough it could take some time to reorganize. Depending on your difficulty algorithm it can take anywhere from 1 blocks to a few thousand to retarget and give the node enough time between blocks to reorganize if needed. Try only mining with one node to start. If that is the problem you can make for a smoother launch by increasing the starting difficulty or the frequency at which it retargets.
Mullick
CC BY-SA 3.0
2015-03-23T17:08:53.507Z
@Mullick I init the nbits to 1f0ffff0. The difficulty changes every 2046 blocks. My two peers do not sync at all even I wait for 1 hour..
moshaholo
<synchronization><peer-discovery>
Altcoin peers do not sync with each other
moshaholo
# Altcoin peers do not sync with each other

(Asked by: username_0 on 2015-03-20)

I created two altcoin peers and they can add blocks to genesis block. However their blockchains do not sync with each other!

The only way let the block merge is to stop a peer and restart the peer.

Is there any solution? Thanks..

**Tags:** synchronization, peer-discovery

> **Comments:**
> **username_1**: Are the two peers connected to each other? Do they have any way of finding out about each other? If not, have you tried adding your own DNS seed in chainparams.cpp, or using the -addnode option?  
> **username_0**: I tested it using two local virtual machines. These two VMware can ping with each other.  Also, I tried using -addnode option..  
> **username_1**: Are they actually connected, though? Does debug.log show successful connections, or does wireshark show traffic on port 9333?  
> **username_0**: @username_1 Yes, they are connected. Bitcoin-cli getpeerinfo show my connected peer.. The peer on one vm is 172.28.128.4:33787, the peer on another vm is 172.28.128.3.  
> **username_2**: How fast is each node mining blocks? If each is mining blocks fast enough it could take some time to reorganize. Depending on your difficulty algorithm it can take anywhere from 1 blocks to a few thousand to retarget and give the node enough time between blocks to reorganize if needed. Try only mining with one node to start. If that is the problem you can make for a smoother launch by increasing the starting difficulty or the frequency at which it retargets.  
> **username_0**: @username_2 I init the nbits to 1f0ffff0. The difficulty changes every 2046 blocks. My two peers do not sync at all even I wait for 1 hour..  

---

## 1 answers

### Answer by username_0 on 2015-04-06. Score: 1 | Accepted answer

Solution found!   
Bitcoin client use checkpoints to prevent 51% attack. [What are checkpoints?](https://bitcoin.stackexchange.com/questions/1797/what-are-checkpoints)

Modifying checkpoints in chainparams.cpp solve this sync problem.


---

