diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-05-27 19:26:00 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-06-06 21:21:49 +0800 |
commit | 4918c820c6d9b64f26b302ed4d1778d94cc7172c (patch) | |
tree | cc973af521defeeb55d4c696a9589dc0a023e809 /trie/sync.go | |
parent | 5904d58a967ba2bd11f700f654f828c00049a1f7 (diff) | |
download | go-tangerine-4918c820c6d9b64f26b302ed4d1778d94cc7172c.tar go-tangerine-4918c820c6d9b64f26b302ed4d1778d94cc7172c.tar.gz go-tangerine-4918c820c6d9b64f26b302ed4d1778d94cc7172c.tar.bz2 go-tangerine-4918c820c6d9b64f26b302ed4d1778d94cc7172c.tar.lz go-tangerine-4918c820c6d9b64f26b302ed4d1778d94cc7172c.tar.xz go-tangerine-4918c820c6d9b64f26b302ed4d1778d94cc7172c.tar.zst go-tangerine-4918c820c6d9b64f26b302ed4d1778d94cc7172c.zip |
[release/1.4.6] eth/downloader, trie: pull head state concurrently with chain
(cherry picked from commit 4f1d92b3329572d75a20b9f9e1cccdf74aa7c79f)
Diffstat (limited to 'trie/sync.go')
-rw-r--r-- | trie/sync.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/trie/sync.go b/trie/sync.go index a35478f83..6e9e029b9 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -17,6 +17,7 @@ package trie import ( + "errors" "fmt" "github.com/ethereum/go-ethereum/common" @@ -24,6 +25,10 @@ import ( "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) +// ErrNotRequested is returned by the trie sync when it's requested to process a +// node it did not request. +var ErrNotRequested = errors.New("not requested") + // request represents a scheduled or already in-flight state retrieval request. type request struct { hash common.Hash // Hash of the node data content to retrieve @@ -144,7 +149,7 @@ func (s *TrieSync) Process(results []SyncResult) (int, error) { // If the item was not requested, bail out request := s.requests[item.Hash] if request == nil { - return i, fmt.Errorf("not requested: %x", item.Hash) + return i, ErrNotRequested } // If the item is a raw entry request, commit directly if request.object == nil { |