eth/downloader: preallocate the block cache

This commit is contained in:
Péter Szilágyi
2015-06-03 19:00:54 +03:00
parent 1d7bf3d39f
commit b40c796ff7
3 changed files with 14 additions and 21 deletions

View File

@ -186,7 +186,7 @@ func TestSynchronisation(t *testing.T) {
if err := tester.sync("peer", hashes[0]); err != nil {
t.Fatalf("failed to synchronise blocks: %v", err)
}
if queued := len(tester.downloader.queue.blockCache); queued != targetBlocks {
if queued := len(tester.downloader.queue.blockPool); queued != targetBlocks {
t.Fatalf("synchronised block mismatch: have %v, want %v", queued, targetBlocks)
}
}