|
|
@ -15,8 +15,8 @@ func (pm *ProtocolManager) update() { |
|
|
|
// itimer is used to determine when to start ignoring `minDesiredPeerCount`
|
|
|
|
// itimer is used to determine when to start ignoring `minDesiredPeerCount`
|
|
|
|
itimer := time.NewTimer(peerCountTimeout) |
|
|
|
itimer := time.NewTimer(peerCountTimeout) |
|
|
|
// btimer is used for picking of blocks from the downloader
|
|
|
|
// btimer is used for picking of blocks from the downloader
|
|
|
|
btimer := time.NewTicker(blockProcTimer) |
|
|
|
btimer := time.Tick(blockProcTimer) |
|
|
|
out: |
|
|
|
|
|
|
|
for { |
|
|
|
for { |
|
|
|
select { |
|
|
|
select { |
|
|
|
case <-pm.newPeerCh: |
|
|
|
case <-pm.newPeerCh: |
|
|
@ -43,10 +43,10 @@ out: |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
itimer.Reset(5 * time.Second) |
|
|
|
itimer.Reset(5 * time.Second) |
|
|
|
} |
|
|
|
} |
|
|
|
case <-btimer.C: |
|
|
|
case <-btimer: |
|
|
|
go pm.processBlocks() |
|
|
|
go pm.processBlocks() |
|
|
|
case <-pm.quitSync: |
|
|
|
case <-pm.quitSync: |
|
|
|
break out |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|