eth/protocols/snap: check storage root existence for hash too

This commit is contained in:
Gary Rong 2024-03-26 10:28:20 +08:00
parent 14cc967d19
commit a03ec5a360

View file

@ -2201,7 +2201,7 @@ func (s *Syncer) processStorageResponse(res *storageResponse) {
// If the chunk's root is an overflown but full delivery, // If the chunk's root is an overflown but full delivery,
// clear the heal request. // clear the heal request.
accountHash := res.accounts[len(res.accounts)-1] accountHash := res.accounts[len(res.accounts)-1]
if root == res.subTask.root && rawdb.HasStorageTrieNode(s.db, accountHash, nil, root) { if root == res.subTask.root && rawdb.HasTrieNode(s.db, accountHash, nil, root, s.scheme) {
for i, account := range res.mainTask.res.hashes { for i, account := range res.mainTask.res.hashes {
if account == accountHash { if account == accountHash {
res.mainTask.needHeal[i] = false res.mainTask.needHeal[i] = false