提交 4b7bdc37 编写于 作者: O obscuren

eth: check if downloader is busy before showing log message

上级 7ac24d55
......@@ -472,3 +472,7 @@ func (d *Downloader) isProcessing() bool {
func (d *Downloader) isBusy() bool {
return d.isFetchingHashes() || d.isDownloadingBlocks() || d.isProcessing()
}
func (d *Downloader) IsBusy() bool {
return d.isBusy()
}
......@@ -163,6 +163,11 @@ func (pm *ProtocolManager) synchronise(peer *peer) {
if peer.td.Cmp(pm.chainman.Td()) <= 0 {
return
}
// Check downloader if it's busy so it doesn't show the sync message
// for every attempty
if pm.downloader.IsBusy() {
return
}
glog.V(logger.Info).Infof("Synchronisation attempt using %s TD=%v\n", peer.id, peer.td)
// Get the hashes from the peer (synchronously)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册