mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-22 15:59:26 +00:00
eth: check if downloader is busy before showing log message
This commit is contained in:
parent
7ac24d551b
commit
4b7bdc3766
2 changed files with 9 additions and 0 deletions
|
|
@ -472,3 +472,7 @@ func (d *Downloader) isProcessing() bool {
|
||||||
func (d *Downloader) isBusy() bool {
|
func (d *Downloader) isBusy() bool {
|
||||||
return d.isFetchingHashes() || d.isDownloadingBlocks() || d.isProcessing()
|
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 {
|
if peer.td.Cmp(pm.chainman.Td()) <= 0 {
|
||||||
return
|
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)
|
glog.V(logger.Info).Infof("Synchronisation attempt using %s TD=%v\n", peer.id, peer.td)
|
||||||
// Get the hashes from the peer (synchronously)
|
// Get the hashes from the peer (synchronously)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue