aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api_backend.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-11-02 20:44:13 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-11-13 21:55:30 +0800
commit4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188 (patch)
tree5c55a3088c944ddf517aa4d7c85c5dc7f02d00e4 /eth/api_backend.go
parent5cd86443ee071b5e3abe4995c777ce467c29f2c5 (diff)
downloaddexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar
dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.gz
dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.bz2
dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.lz
dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.xz
dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.zst
dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.zip
core/types, params: EIP#155
Diffstat (limited to 'eth/api_backend.go')
-rw-r--r--eth/api_backend.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/eth/api_backend.go b/eth/api_backend.go
index f17ad6a15..0925132ef 100644
--- a/eth/api_backend.go
+++ b/eth/api_backend.go
@@ -30,6 +30,7 @@ import (
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/internal/ethapi"
+ "github.com/ethereum/go-ethereum/params"
rpc "github.com/ethereum/go-ethereum/rpc"
"golang.org/x/net/context"
)
@@ -40,6 +41,14 @@ type EthApiBackend struct {
gpo *gasprice.GasPriceOracle
}
+func (b *EthApiBackend) ChainConfig() *params.ChainConfig {
+ return b.eth.chainConfig
+}
+
+func (b *EthApiBackend) CurrentBlock() *types.Block {
+ return b.eth.blockchain.CurrentBlock()
+}
+
func (b *EthApiBackend) SetHead(number uint64) {
b.eth.blockchain.SetHead(number)
}
@@ -99,8 +108,7 @@ func (b *EthApiBackend) GetTd(blockHash common.Hash) *big.Int {
func (b *EthApiBackend) GetVMEnv(ctx context.Context, msg core.Message, state ethapi.State, header *types.Header) (vm.Environment, func() error, error) {
statedb := state.(EthApiState).state
- addr, _ := msg.From()
- from := statedb.GetOrNewStateObject(addr)
+ from := statedb.GetOrNewStateObject(msg.From())
from.SetBalance(common.MaxBig)
vmError := func() error { return nil }
return core.NewEnv(statedb, b.eth.chainConfig, b.eth.blockchain, msg, header, vm.Config{}), vmError, nil