eth/downloader: fix #910, thread safe peers & polishes

This commit is contained in:
Péter Szilágyi
2015-05-11 14:26:20 +03:00
parent 00280e62e3
commit 685862d2ce
4 changed files with 214 additions and 165 deletions

View File

@ -229,7 +229,7 @@ func TestThrottling(t *testing.T) {
minDesiredPeerCount = 4
blockTtl = 1 * time.Second
targetBlocks := 4 * blockCacheLimit
targetBlocks := 16 * blockCacheLimit
hashes := createHashes(0, targetBlocks)
blocks := createBlocksFromHashes(hashes)
tester := newTester(t, hashes, blocks)
@ -256,6 +256,7 @@ func TestThrottling(t *testing.T) {
return
default:
took = append(took, tester.downloader.TakeBlocks()...)
time.Sleep(time.Millisecond)
}
}
}()