aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
Diffstat (limited to 'eth')
-rw-r--r--eth/downloader/downloader.go6
-rw-r--r--eth/handler.go5
2 files changed, 11 insertions, 0 deletions
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go
index 60d908758..a3917854f 100644
--- a/eth/downloader/downloader.go
+++ b/eth/downloader/downloader.go
@@ -436,6 +436,8 @@ func (d *Downloader) process(peer *peer) error {
if err != nil && core.IsParentErr(err) {
glog.V(logger.Debug).Infoln("Aborting process due to missing parent.")
+ // XXX this needs a lot of attention
+ blocks = nil
break
} else if err != nil {
// immediatly unregister the false peer but do not disconnect
@@ -472,3 +474,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()
+}
diff --git a/eth/handler.go b/eth/handler.go
index d00d00f23..61149049e 100644
--- a/eth/handler.go
+++ b/eth/handler.go
@@ -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)