From 586eddfd09558bfd71f23c2e50c270d2ca665d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 28 Apr 2016 12:00:11 +0300 Subject: release, all: integrate the release service into geth --- eth/backend.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'eth/backend.go') diff --git a/eth/backend.go b/eth/backend.go index 76cf8783b..9722e9625 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -119,6 +119,7 @@ type Ethereum struct { protocolManager *ProtocolManager SolcPath string solc *compiler.Solidity + gpo *GasPriceOracle GpoMinGasPrice *big.Int GpoMaxGasPrice *big.Int @@ -260,6 +261,8 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { } return nil, err } + eth.gpo = NewGasPriceOracle(eth) + newPool := core.NewTxPool(eth.chainConfig, eth.EventMux(), eth.blockchain.State, eth.blockchain.GasLimit) eth.txPool = newPool @@ -276,34 +279,31 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { // APIs returns the collection of RPC services the ethereum package offers. // NOTE, some of these services probably need to be moved to somewhere else. func (s *Ethereum) APIs() []rpc.API { - // share gas price oracle in API's - gpo := NewGasPriceOracle(s) - return []rpc.API{ { Namespace: "eth", Version: "1.0", - Service: NewPublicEthereumAPI(s, gpo), + Service: NewPublicEthereumAPI(s), Public: true, }, { Namespace: "eth", Version: "1.0", - Service: NewPublicAccountAPI(s.AccountManager()), + Service: NewPublicAccountAPI(s.accountManager), Public: true, }, { Namespace: "personal", Version: "1.0", - Service: NewPrivateAccountAPI(s.AccountManager()), + Service: NewPrivateAccountAPI(s.accountManager), Public: false, }, { Namespace: "eth", Version: "1.0", - Service: NewPublicBlockChainAPI(s.chainConfig, s.BlockChain(), s.Miner(), s.ChainDb(), gpo, s.EventMux(), s.AccountManager()), + Service: NewPublicBlockChainAPI(s.chainConfig, s.blockchain, s.miner, s.chainDb, s.gpo, s.eventMux, s.accountManager), Public: true, }, { Namespace: "eth", Version: "1.0", - Service: NewPublicTransactionPoolAPI(s, gpo), + Service: NewPublicTransactionPoolAPI(s), Public: true, }, { Namespace: "eth", @@ -313,7 +313,7 @@ func (s *Ethereum) APIs() []rpc.API { }, { Namespace: "eth", Version: "1.0", - Service: downloader.NewPublicDownloaderAPI(s.Downloader(), s.EventMux()), + Service: downloader.NewPublicDownloaderAPI(s.protocolManager.downloader, s.eventMux), Public: true, }, { Namespace: "miner", @@ -328,7 +328,7 @@ func (s *Ethereum) APIs() []rpc.API { }, { Namespace: "eth", Version: "1.0", - Service: filters.NewPublicFilterAPI(s.ChainDb(), s.EventMux()), + Service: filters.NewPublicFilterAPI(s.chainDb, s.eventMux), Public: true, }, { Namespace: "admin", @@ -351,7 +351,7 @@ func (s *Ethereum) APIs() []rpc.API { }, { Namespace: "admin", Version: "1.0", - Service: ethreg.NewPrivateRegistarAPI(s.chainConfig, s.BlockChain(), s.ChainDb(), s.TxPool(), s.AccountManager()), + Service: ethreg.NewPrivateRegistarAPI(s.chainConfig, s.blockchain, s.chainDb, s.txPool, s.accountManager), }, } } -- cgit v1.2.3