mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "eth,internal: no need to check zero root"
This reverts commit 4edc99fe5d.
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
7901d05094
commit
b124fb4dd4
2 changed files with 2 additions and 2 deletions
|
|
@ -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) {
|
func storageRangeAt(statedb *state.StateDB, root common.Hash, address common.Address, start []byte, maxResult int) (StorageRangeResult, error) {
|
||||||
storageRoot := statedb.GetStorageRoot(address)
|
storageRoot := statedb.GetStorageRoot(address)
|
||||||
if storageRoot == types.EmptyRootHash {
|
if storageRoot == types.EmptyRootHash || storageRoot == (common.Hash{}) {
|
||||||
return StorageRangeResult{}, nil // empty storage
|
return StorageRangeResult{}, nil // empty storage
|
||||||
}
|
}
|
||||||
id := trie.StorageTrieID(root, crypto.Keccak256Hash(address.Bytes()), storageRoot)
|
id := trie.StorageTrieID(root, crypto.Keccak256Hash(address.Bytes()), storageRoot)
|
||||||
|
|
|
||||||
|
|
@ -693,7 +693,7 @@ func (s *BlockChainAPI) GetProof(ctx context.Context, address common.Address, st
|
||||||
|
|
||||||
if len(keys) > 0 {
|
if len(keys) > 0 {
|
||||||
var storageTrie state.Trie
|
var storageTrie state.Trie
|
||||||
if storageRoot != types.EmptyRootHash {
|
if storageRoot != types.EmptyRootHash && storageRoot != (common.Hash{}) {
|
||||||
id := trie.StorageTrieID(header.Root, crypto.Keccak256Hash(address.Bytes()), storageRoot)
|
id := trie.StorageTrieID(header.Root, crypto.Keccak256Hash(address.Bytes()), storageRoot)
|
||||||
st, err := trie.NewStateTrie(id, statedb.Database().TrieDB())
|
st, err := trie.NewStateTrie(id, statedb.Database().TrieDB())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue