eth/downloader: check sync after failed attacks

This commit is contained in:
Péter Szilágyi
2015-05-15 02:14:21 +03:00
parent 366e9627e8
commit bcc2980179
2 changed files with 23 additions and 7 deletions

View File

@ -268,8 +268,12 @@ out:
// Insert all the new hashes, but only continue if got something useful
inserts := d.queue.Insert(hashPack.hashes)
if inserts == 0 && !done {
glog.V(logger.Debug).Infof("Peer (%s) responded with stale hashes\n", activePeer.id)
d.queue.Reset()
return ErrBadPeer
} else if !done {
}
if !done {
activePeer.getHashes(hash)
continue
}