diff --git a/core/state/statedb.go b/core/state/statedb.go index 790963c19d..d8869a2d4d 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -314,14 +314,18 @@ func (s *StateDB) GetAccountInfo(addr common.Address) *AccountInfo { stateObject := s.getStateObject(addr) if stateObject == nil { - result.Balance = common.Big0 + result.Balance = new(big.Int) return &result } if stateObject.code != nil { result.CodeSize = len(stateObject.code) } else { - result.CodeSize, _ = s.db.ContractCodeSize(stateObject.addrHash, common.BytesToHash(stateObject.CodeHash())) + size, err := s.db.ContractCodeSize(stateObject.addrHash, common.BytesToHash(stateObject.CodeHash())) + if err != nil { + s.setError(err) + } + result.CodeSize = size } result.Nonce = stateObject.Nonce() result.Balance = stateObject.Balance() diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index e76ca05054..f4a66e1642 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -509,7 +509,7 @@ func (api *BlockChainAPI) GetAccountInfo(ctx context.Context, address common.Add "nonce": info.Nonce, "storageHash": info.StorageHash, } - return result, nil + return result, state.Error() } // GetStorageAt returns the storage from the state at the given address, key and