1
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..
1
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..
1
Solution found!
Bitcoin client use checkpoints to prevent 51% attack. What are checkpoints?
Modifying checkpoints in chainparams.cpp solve this sync problem.
1Are 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 – 2015-03-20T04:13:13.200
I tested it using two local virtual machines. These two VMware can ping with each other. Also, I tried using -addnode option.. – moshaholo – 2015-03-20T13:16:16.160
Are they actually connected, though? Does debug.log show successful connections, or does wireshark show traffic on port 9333? – Nick ODell – 2015-03-20T19:24:40.927
@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 – 2015-03-20T19:47:22.153
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 – 2015-03-23T04:43:14.207
@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 – 2015-03-23T17:08:53.507