mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-15 20:46:40 +00:00
fix: skip storage entries with missing preimage keys (#32051)
When `GetKey` is called, a missing preimage can cause the function to return a `nil` key. This, in turn, makes `account.Storage` persist an incorrect value.
This commit is contained in:
parent
65d77c5129
commit
05e199408f
1 changed files with 5 additions and 1 deletions
|
|
@ -182,7 +182,11 @@ func (s *StateDB) DumpToCollector(c DumpCollector, conf *DumpConfig) (nextKey []
|
||||||
log.Error("Failed to decode the value returned by iterator", "error", err)
|
log.Error("Failed to decode the value returned by iterator", "error", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
account.Storage[common.BytesToHash(s.trie.GetKey(storageIt.Key))] = common.Bytes2Hex(content)
|
key := s.trie.GetKey(storageIt.Key)
|
||||||
|
if key == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
account.Storage[common.BytesToHash(key)] = common.Bytes2Hex(content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.OnAccount(address, account)
|
c.OnAccount(address, account)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue