aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-04-28 17:00:11 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-05-02 21:20:21 +0800
commit586eddfd09558bfd71f23c2e50c270d2ca665d49 (patch)
tree4015e542e0397c606d1f14ef23d15463881be554 /eth/backend.go
parentd46da273c6731512b4114393856a96be06505797 (diff)
downloadgo-tangerine-586eddfd09558bfd71f23c2e50c270d2ca665d49.tar
go-tangerine-586eddfd09558bfd71f23c2e50c270d2ca665d49.tar.gz
go-tangerine-586eddfd09558bfd71f23c2e50c270d2ca665d49.tar.bz2
go-tangerine-586eddfd09558bfd71f23c2e50c270d2ca665d49.tar.lz
go-tangerine-586eddfd09558bfd71f23c2e50c270d2ca665d49.tar.xz
go-tangerine-586eddfd09558bfd71f23c2e50c270d2ca665d49.tar.zst
go-tangerine-586eddfd09558bfd71f23c2e50c270d2ca665d49.zip
release, all: integrate the release service into geth
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go22
1 files changed, 11 insertions, 11 deletions
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),
},
}
}