mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-09 14:34:27 +00:00
eth/protocols/snap: fix access list sync progress double counting (#35323)
This commit is contained in:
parent
76e3dc6b5b
commit
6c80ee6c50
1 changed files with 3 additions and 1 deletions
|
|
@ -963,6 +963,7 @@ func (s *syncerV2) fetchAccessLists(hashes []common.Hash, headers map[common.Has
|
|||
accessListReqFails = make(chan *accessListRequest)
|
||||
accessListResps = make(chan *accessListResponse)
|
||||
lastStallLog = time.Now()
|
||||
lastFetched = 0
|
||||
)
|
||||
for len(fetched) < len(hashes) {
|
||||
if err := s.checkAccessListProgress(pending, refused); err != nil {
|
||||
|
|
@ -1000,7 +1001,8 @@ func (s *syncerV2) fetchAccessLists(hashes []common.Hash, headers map[common.Has
|
|||
s.processAccessListResponse(res, headers, pending, fetched, refused)
|
||||
}
|
||||
s.lock.Lock()
|
||||
s.accessListSynced += uint64(len(fetched))
|
||||
s.accessListSynced += uint64(len(fetched) - lastFetched)
|
||||
lastFetched = len(fetched)
|
||||
s.refreshProgressLocked()
|
||||
s.lock.Unlock()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue