eth: don't block sync goroutines that short circuit
This commit is contained in:
@ -170,13 +170,16 @@ func (pm *ProtocolManager) synchronise(peer *peer) {
|
||||
if pm.fastSync {
|
||||
mode = downloader.FastSync
|
||||
}
|
||||
pm.downloader.Synchronise(peer.id, peer.Head(), peer.Td(), mode)
|
||||
|
||||
if err := pm.downloader.Synchronise(peer.id, peer.Head(), peer.Td(), mode); err != nil {
|
||||
return
|
||||
}
|
||||
// If fast sync was enabled, and we synced up, disable it
|
||||
if pm.fastSync {
|
||||
// Wait until all pending imports finish processing
|
||||
for pm.downloader.Synchronising() {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
}
|
||||
// Disable fast sync if we indeed have something in our chain
|
||||
if pm.blockchain.CurrentBlock().NumberU64() > 0 {
|
||||
glog.V(logger.Info).Infof("fast sync complete, auto disabling")
|
||||
pm.fastSync = false
|
||||
|
Reference in New Issue
Block a user