diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-19 00:54:57 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-19 00:55:13 +0800 |
commit | c2c24b3bb419a8ffffb58ec25788b951bef779f9 (patch) | |
tree | 1d646493e36a0056b1d34fc8e876a9a5123c3fa2 /eth/downloader/queue.go | |
parent | 60613b57d1956275bb475a53b5085c4ead4ceb2c (diff) | |
download | go-tangerine-c2c24b3bb419a8ffffb58ec25788b951bef779f9.tar.gz go-tangerine-c2c24b3bb419a8ffffb58ec25788b951bef779f9.tar.zst go-tangerine-c2c24b3bb419a8ffffb58ec25788b951bef779f9.zip |
downloader: improved downloading and synchronisation
* Downloader's peers keeps track of peer's previously requested hashes
so that we don't have to re-request
* Changed `AddBlock` to be fully synchronous
Diffstat (limited to 'eth/downloader/queue.go')
-rw-r--r-- | eth/downloader/queue.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index df3bf7087..5745bf1f8 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -65,6 +65,9 @@ func (c *queue) get(p *peer, max int) *chunk { return true }) + // remove hashes that have previously been fetched + hashes.Separate(p.requested) + // remove the fetchable hashes from hash pool c.hashPool.Separate(hashes) c.fetchPool.Merge(hashes) |