eth,internal: no need to check zero root

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2023-10-31 19:28:44 +08:00
parent 2da6edc1a8
commit 4edc99fe5d
2 changed files with 2 additions and 2 deletions

View file

@ -231,7 +231,7 @@ func (api *DebugAPI) StorageRangeAt(ctx context.Context, blockNrOrHash rpc.Block
func storageRangeAt(statedb *state.StateDB, root common.Hash, address common.Address, start []byte, maxResult int) (StorageRangeResult, error) {
storageRoot := statedb.GetStorageRoot(address)
if storageRoot == types.EmptyRootHash || storageRoot == (common.Hash{}) {
if storageRoot == types.EmptyRootHash {
return StorageRangeResult{}, nil // empty storage
}
id := trie.StorageTrieID(root, crypto.Keccak256Hash(address.Bytes()), storageRoot)

View file

@ -693,7 +693,7 @@ func (s *BlockChainAPI) GetProof(ctx context.Context, address common.Address, st
if len(keys) > 0 {
var storageTrie state.Trie
if storageRoot != types.EmptyRootHash && storageRoot != (common.Hash{}) {
if storageRoot != types.EmptyRootHash {
id := trie.StorageTrieID(header.Root, crypto.Keccak256Hash(address.Bytes()), storageRoot)
st, err := trie.NewStateTrie(id, statedb.Database().TrieDB())
if err != nil {