eth/downloader: prioritize block fetch based on chain position, cap memory use

This commit is contained in:
Péter Szilágyi
2015-05-06 15:32:53 +03:00
parent 97c37356fd
commit 4800c94392
11 changed files with 808 additions and 283 deletions

View File

@ -128,7 +128,7 @@ func TestDownload(t *testing.T) {
t.Error("download error", err)
}
inqueue := len(tester.downloader.queue.blocks)
inqueue := len(tester.downloader.queue.blockCache)
if inqueue != targetBlocks {
t.Error("expected", targetBlocks, "have", inqueue)
}
@ -151,7 +151,7 @@ func TestMissing(t *testing.T) {
t.Error("download error", err)
}
inqueue := len(tester.downloader.queue.blocks)
inqueue := len(tester.downloader.queue.blockCache)
if inqueue != targetBlocks {
t.Error("expected", targetBlocks, "have", inqueue)
}