diff --git a/eth/api_backend.go b/eth/api_backend.go index f10af0cc2..0235ccdcc 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -223,18 +223,30 @@ type EthApiState struct { } func (s EthApiState) GetBalance(addr common.Address) *big.Int { + if s.privateState.Exist(addr) { + return s.privateState.GetBalance(addr) + } return s.state.GetBalance(addr) } func (s EthApiState) GetCode(addr common.Address) []byte { + if s.privateState.Exist(addr) { + return s.privateState.GetCode(addr) + } return s.state.GetCode(addr) } func (s EthApiState) GetState(a common.Address, b common.Hash) common.Hash { + if s.privateState.Exist(a) { + return s.privateState.GetState(a, b) + } return s.state.GetState(a, b) } func (s EthApiState) GetNonce(addr common.Address) uint64 { + if s.privateState.Exist(addr) { + return s.privateState.GetNonce(addr) + } return s.state.GetNonce(addr) } diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 9b44c9208..80ea8b6e4 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -830,7 +830,7 @@ type RPCTransaction struct { // newRPCTransaction returns a transaction that will serialize to the RPC // representation, with the given location metadata set (if available). func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, index uint64) *RPCTransaction { - var signer types.Signer = types.FrontierSigner{} + var signer types.Signer = types.HomesteadSigner{} if tx.Protected() { signer = types.NewEIP155Signer(tx.ChainId()) } @@ -1000,7 +1000,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(hash common.Hash) (map[ } receipt, _, _, _ := core.GetReceipt(s.b.ChainDb(), hash) // Old receipts don't have the lookup data available - var signer types.Signer = types.FrontierSigner{} + var signer types.Signer = types.HomesteadSigner{} if tx.Protected() { signer = types.NewEIP155Signer(tx.ChainId()) }