aboutsummaryrefslogtreecommitdiffstats
path: root/les/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 /les/api_backend.go
parent5cd86443ee071b5e3abe4995c777ce467c29f2c5 (diff)
downloadgo-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.gz
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.bz2
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.lz
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.xz
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.zst
go-tangerine-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.zip
core/types, params: EIP#155
Diffstat (limited to 'les/api_backend.go')
-rw-r--r--les/api_backend.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/les/api_backend.go b/les/api_backend.go
index 42d6cc473..b77767ed7 100644
--- a/les/api_backend.go
+++ b/les/api_backend.go
@@ -30,6 +30,7 @@ import (
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/light"
+ "github.com/ethereum/go-ethereum/params"
rpc "github.com/ethereum/go-ethereum/rpc"
"golang.org/x/net/context"
)
@@ -39,6 +40,14 @@ type LesApiBackend struct {
gpo *gasprice.LightPriceOracle
}
+func (b *LesApiBackend) ChainConfig() *params.ChainConfig {
+ return b.eth.chainConfig
+}
+
+func (b *LesApiBackend) CurrentBlock() *types.Block {
+ return types.NewBlockWithHeader(b.eth.BlockChain().CurrentHeader())
+}
+
func (b *LesApiBackend) SetHead(number uint64) {
b.eth.blockchain.SetHead(number)
}
@@ -81,7 +90,7 @@ func (b *LesApiBackend) GetTd(blockHash common.Hash) *big.Int {
func (b *LesApiBackend) GetVMEnv(ctx context.Context, msg core.Message, state ethapi.State, header *types.Header) (vm.Environment, func() error, error) {
stateDb := state.(*light.LightState).Copy()
- addr, _ := msg.From()
+ addr := msg.From()
from, err := stateDb.GetOrNewStateObject(ctx, addr)
if err != nil {
return nil, nil, err