mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
core/state: address comments
This commit is contained in:
parent
a70367b8ae
commit
2758b1af48
2 changed files with 6 additions and 11 deletions
|
|
@ -181,16 +181,16 @@ func (s *StateDB) DumpToCollector(c DumpCollector, conf *DumpConfig) (nextKey []
|
|||
return nil, err
|
||||
}
|
||||
for storageIt.Next() {
|
||||
key, err := storageIt.Key()
|
||||
if err != nil {
|
||||
// Silently ignore the storage slot without the key preimage.
|
||||
continue
|
||||
}
|
||||
val := storageIt.Slot()
|
||||
if err := storageIt.Error(); err != nil {
|
||||
storageIt.Release()
|
||||
return nil, err
|
||||
}
|
||||
account.Storage[key] = val.Hex()
|
||||
key, err := storageIt.Key()
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
account.Storage[key] = common.Bytes2Hex(common.TrimLeftZeroes(val[:]))
|
||||
}
|
||||
storageIt.Release()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,11 +127,6 @@ func NewStateUpdate(typ StorageKeyEncoding, originRoot common.Hash, root common.
|
|||
accounts[addrHash] = nil
|
||||
accountsOrigin[addr] = op.Origin
|
||||
|
||||
// If storage wiping is present, the StorageKeyEncoding MUST be hashed.
|
||||
// Deleted storage slots are iterated from either the trie or the flat
|
||||
// state snapshot, both of which use the storage slot hash as the identifier.
|
||||
// Fortunately, storage wiping is no longer practical after the Cancun fork
|
||||
// and is not expected to occur.
|
||||
if len(op.Storages) > 0 {
|
||||
storages[addrHash] = op.Storages
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue