copernet / copernicus

An alternative implementation of the Bitcoin Cash protocol, written in Golang
https://copernet.io
BSD 2-Clause "Simplified" License
85 stars 34 forks source link

Add initial-headers-sync timeout handling to fix issue #217 #221

Closed whunmr closed 5 years ago

whunmr commented 5 years ago
2018/12/14 09:46:23.789 [E] [syncmanager.go:237]  disconnect timeout sync peer:213.227.140.194:8333
2018/12/14 09:46:23.789 [E] [syncmanager.go:243]  sync headers from peer timeout, restart sync
whunmr commented 5 years ago

@whitefen @Radar3 please help to review these commits. thanks.

Radar3 commented 5 years ago

I have reviewed the code. Every change looks well. But one thing should be care: If there are very few peers, or only one peer, disconnect that peer may be dangerous.