eth/downloader: progress in stateSync not used anymore

This commit is contained in:
Delweng Zheng 2018-10-29 19:51:45 +08:00
parent 54f650a3be
commit d6170bfa53

View file

@ -399,7 +399,7 @@ func (s *stateSync) fillTasks(n int, req *stateReq) {
// into a running state sync, re-queuing any items that were requested but not // into a running state sync, re-queuing any items that were requested but not
// delivered. // delivered.
func (s *stateSync) process(req *stateReq) error { func (s *stateSync) process(req *stateReq) error {
// Collect processing stats and update progress if valid data was received // Collect processing stats
duplicate, unexpected := 0, 0 duplicate, unexpected := 0, 0
defer func(start time.Time) { defer func(start time.Time) {
@ -409,15 +409,12 @@ func (s *stateSync) process(req *stateReq) error {
}(time.Now()) }(time.Now())
// Iterate over all the delivered data and inject one-by-one into the trie // Iterate over all the delivered data and inject one-by-one into the trie
progress := false
for _, blob := range req.response { for _, blob := range req.response {
prog, hash, err := s.processNodeData(blob) _, hash, err := s.processNodeData(blob)
switch err { switch err {
case nil: case nil:
s.numUncommitted++ s.numUncommitted++
s.bytesUncommitted += len(blob) s.bytesUncommitted += len(blob)
progress = progress || prog
case trie.ErrNotRequested: case trie.ErrNotRequested:
unexpected++ unexpected++
case trie.ErrAlreadyProcessed: case trie.ErrAlreadyProcessed: