eth, eth/downloader: handle sync errors a bit more gracefully

This commit is contained in:
Péter Szilágyi
2015-05-08 15:22:48 +03:00
parent 9d188f73b5
commit bd5720f480
4 changed files with 48 additions and 48 deletions

View File

@ -61,7 +61,7 @@ func newTester(t *testing.T, hashes []common.Hash, blocks map[common.Hash]*types
func (dl *downloadTester) sync(peerId string, hash common.Hash) error {
dl.activePeerId = peerId
return dl.downloader.Synchronize(peerId, hash)
return dl.downloader.Synchronise(peerId, hash)
}
func (dl *downloadTester) hasBlock(hash common.Hash) bool {
@ -217,13 +217,13 @@ func TestThrottling(t *testing.T) {
}
}()
// Synchronize the two threads and verify
// Synchronise the two threads and verify
err := <-errc
done <- struct{}{}
<-done
if err != nil {
t.Fatalf("failed to synchronize blocks: %v", err)
t.Fatalf("failed to synchronise blocks: %v", err)
}
if len(took) != targetBlocks {
t.Fatalf("downloaded block mismatch: have %v, want %v", len(took), targetBlocks)