diff options
author | Wenbiao Zheng <delweng@gmail.com> | 2018-12-22 06:36:14 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-12-22 06:36:14 +0800 |
commit | 81c3dc728f946db26a31a6974383b94b11dba977 (patch) | |
tree | b217663a9e7ad4bb3abb8c37be70bb55eb9f3131 /eth | |
parent | ca7c13ba8f8af19f15e84a16e82049f2b32b6b70 (diff) | |
download | dexon-81c3dc728f946db26a31a6974383b94b11dba977.tar dexon-81c3dc728f946db26a31a6974383b94b11dba977.tar.gz dexon-81c3dc728f946db26a31a6974383b94b11dba977.tar.bz2 dexon-81c3dc728f946db26a31a6974383b94b11dba977.tar.lz dexon-81c3dc728f946db26a31a6974383b94b11dba977.tar.xz dexon-81c3dc728f946db26a31a6974383b94b11dba977.tar.zst dexon-81c3dc728f946db26a31a6974383b94b11dba977.zip |
eth/downloader: progress in stateSync not used anymore (#17998)
Diffstat (limited to 'eth')
-rw-r--r-- | eth/downloader/statesync.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 29d5ee4dd..9a924bbcc 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -152,7 +152,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync { finished = append(finished, req) delete(active, pack.PeerId()) - // Handle dropped peer connections: + // Handle dropped peer connections: case p := <-peerDrop: // Skip if no request is currently pending req := active[p.id] @@ -398,9 +398,8 @@ func (s *stateSync) fillTasks(n int, req *stateReq) { // process iterates over a batch of delivered state data, injecting each item // into a running state sync, re-queuing any items that were requested but not -// delivered. -// Returns whether the peer actually managed to deliver anything of value, -// and any error that occurred +// delivered. Returns whether the peer actually managed to deliver anything of +// value, and any error that occurred. func (s *stateSync) process(req *stateReq) (int, error) { // Collect processing stats and update progress if valid data was received duplicate, unexpected, successful := 0, 0, 0 @@ -412,14 +411,12 @@ func (s *stateSync) process(req *stateReq) (int, error) { }(time.Now()) // Iterate over all the delivered data and inject one-by-one into the trie - progress := false for _, blob := range req.response { - prog, hash, err := s.processNodeData(blob) + _, hash, err := s.processNodeData(blob) switch err { case nil: s.numUncommitted++ s.bytesUncommitted += len(blob) - progress = progress || prog successful++ case trie.ErrNotRequested: unexpected++ |