mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/state, eth, internal/ethapi: address comments
This commit is contained in:
parent
6c825a92f3
commit
6dbca7e186
3 changed files with 4 additions and 4 deletions
|
|
@ -295,9 +295,9 @@ func (s *StateDB) GetNonce(addr common.Address) uint64 {
|
|||
return 0
|
||||
}
|
||||
|
||||
// GetStateRoot retrieves the storage root from the given address or empty
|
||||
// GetStorageRoot retrieves the storage root from the given address or empty
|
||||
// if object not found.
|
||||
func (s *StateDB) GetStateRoot(addr common.Address) common.Hash {
|
||||
func (s *StateDB) GetStorageRoot(addr common.Address) common.Hash {
|
||||
stateObject := s.getStateObject(addr)
|
||||
if stateObject != nil {
|
||||
return stateObject.Root()
|
||||
|
|
|
|||
|
|
@ -230,7 +230,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.GetStateRoot(address)
|
||||
storageRoot := statedb.GetStorageRoot(address)
|
||||
if storageRoot == types.EmptyRootHash || storageRoot == (common.Hash{}) {
|
||||
return StorageRangeResult{}, nil // empty storage
|
||||
}
|
||||
|
|
|
|||
|
|
@ -692,7 +692,7 @@ func (s *BlockChainAPI) GetProof(ctx context.Context, address common.Address, st
|
|||
if state == nil || err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if storageRoot := state.GetStateRoot(address); storageRoot != types.EmptyRootHash && storageRoot != (common.Hash{}) {
|
||||
if storageRoot := state.GetStorageRoot(address); storageRoot != types.EmptyRootHash && storageRoot != (common.Hash{}) {
|
||||
id := trie.StorageTrieID(header.Root, crypto.Keccak256Hash(address.Bytes()), storageRoot)
|
||||
tr, err := trie.NewStateTrie(id, state.Database().TrieDB())
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue