diff --git a/core/state/statedb.go b/core/state/statedb.go index 8661982cb3..7b1f6b2304 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -294,14 +294,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 567300a2e7..4429c5e4e7 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -478,7 +478,7 @@ func (s *PublicBlockChainAPI) GetAccountInfo(ctx context.Context, address common "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