From cd2fb0905109828028172c84f9c10f1343647ca6 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Fri, 15 May 2015 01:40:16 +0300 Subject: eth, eth/downloader: prevent hash repeater attack --- eth/sync.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'eth/sync.go') diff --git a/eth/sync.go b/eth/sync.go index c89f34596..73f6253be 100644 --- a/eth/sync.go +++ b/eth/sync.go @@ -101,11 +101,13 @@ func (pm *ProtocolManager) synchronise(peer *peer) { case downloader.ErrBusy: glog.V(logger.Debug).Infof("Synchronisation already in progress") - case downloader.ErrTimeout: - glog.V(logger.Debug).Infof("Removing peer %v due to sync timeout", peer.id) + case downloader.ErrTimeout, downloader.ErrBadPeer: + glog.V(logger.Debug).Infof("Removing peer %v: %v", peer.id, err) pm.removePeer(peer) + case downloader.ErrPendingQueue: glog.V(logger.Debug).Infoln("Synchronisation aborted:", err) + default: glog.V(logger.Warn).Infof("Synchronisation failed: %v", err) } -- cgit