aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api_backend.go
diff options
context:
space:
mode:
Diffstat (limited to 'eth/api_backend.go')
-rw-r--r--eth/api_backend.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/eth/api_backend.go b/eth/api_backend.go
index 5a5c4c532..fe108d272 100644
--- a/eth/api_backend.go
+++ b/eth/api_backend.go
@@ -17,6 +17,7 @@
package eth
import (
+ "context"
"math/big"
"github.com/ethereum/go-ethereum/accounts"
@@ -33,13 +34,12 @@ import (
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
- "golang.org/x/net/context"
)
// EthApiBackend implements ethapi.Backend for full nodes
type EthApiBackend struct {
eth *Ethereum
- gpo *gasprice.GasPriceOracle
+ gpo *gasprice.Oracle
}
func (b *EthApiBackend) ChainConfig() *params.ChainConfig {
@@ -51,6 +51,7 @@ func (b *EthApiBackend) CurrentBlock() *types.Block {
}
func (b *EthApiBackend) SetHead(number uint64) {
+ b.eth.protocolManager.downloader.Cancel()
b.eth.blockchain.SetHead(number)
}
@@ -113,7 +114,7 @@ func (b *EthApiBackend) GetEVM(ctx context.Context, msg core.Message, state etha
from.SetBalance(math.MaxBig256)
vmError := func() error { return nil }
- context := core.NewEVMContext(msg, header, b.eth.BlockChain())
+ context := core.NewEVMContext(msg, header, b.eth.BlockChain(), nil)
return vm.NewEVM(context, statedb, b.eth.chainConfig, vmCfg), vmError, nil
}
@@ -185,7 +186,7 @@ func (b *EthApiBackend) ProtocolVersion() int {
}
func (b *EthApiBackend) SuggestPrice(ctx context.Context) (*big.Int, error) {
- return b.gpo.SuggestPrice(), nil
+ return b.gpo.SuggestPrice(ctx)
}
func (b *EthApiBackend) ChainDb() ethdb.Database {