diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-06-11 20:56:08 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-06-15 14:22:36 +0800 |
commit | 66d3dc8690e0aa551e7b35a17006a2135b51c9bd (patch) | |
tree | 2e58d41dd5995e1b7c8d9c6f52b881e0c7934fbd /eth/backend.go | |
parent | 6f5c6150b7060b6b2ee68ac95b30f46c5c2c7f90 (diff) | |
download | dexon-66d3dc8690e0aa551e7b35a17006a2135b51c9bd.tar dexon-66d3dc8690e0aa551e7b35a17006a2135b51c9bd.tar.gz dexon-66d3dc8690e0aa551e7b35a17006a2135b51c9bd.tar.bz2 dexon-66d3dc8690e0aa551e7b35a17006a2135b51c9bd.tar.lz dexon-66d3dc8690e0aa551e7b35a17006a2135b51c9bd.tar.xz dexon-66d3dc8690e0aa551e7b35a17006a2135b51c9bd.tar.zst dexon-66d3dc8690e0aa551e7b35a17006a2135b51c9bd.zip |
eth, eth/downloader: move peer removal into downloader
Diffstat (limited to 'eth/backend.go')
-rw-r--r-- | eth/backend.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/eth/backend.go b/eth/backend.go index d2ec0cc62..4ebf21811 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -193,7 +193,6 @@ type Ethereum struct { whisper *whisper.Whisper pow *ethash.Ethash protocolManager *ProtocolManager - downloader *downloader.Downloader SolcPath string solc *compiler.Solidity @@ -290,14 +289,13 @@ func New(config *Config) (*Ethereum, error) { if err != nil { return nil, err } - eth.downloader = downloader.New(eth.EventMux(), eth.chainManager.HasBlock, eth.chainManager.GetBlock) eth.txPool = core.NewTxPool(eth.EventMux(), eth.chainManager.State, eth.chainManager.GasLimit) eth.blockProcessor = core.NewBlockProcessor(stateDb, extraDb, eth.pow, eth.chainManager, eth.EventMux()) eth.chainManager.SetProcessor(eth.blockProcessor) + eth.protocolManager = NewProtocolManager(config.ProtocolVersion, config.NetworkId, eth.eventMux, eth.txPool, eth.chainManager) + eth.miner = miner.New(eth, eth.EventMux(), eth.pow) eth.miner.SetGasPrice(config.GasPrice) - - eth.protocolManager = NewProtocolManager(config.ProtocolVersion, config.NetworkId, eth.eventMux, eth.txPool, eth.chainManager, eth.downloader) if config.Shh { eth.whisper = whisper.New() eth.shhVersionId = int(eth.whisper.Version()) @@ -447,7 +445,7 @@ func (s *Ethereum) ClientVersion() string { return s.clientVersio func (s *Ethereum) EthVersion() int { return s.ethVersionId } func (s *Ethereum) NetVersion() int { return s.netVersionId } func (s *Ethereum) ShhVersion() int { return s.shhVersionId } -func (s *Ethereum) Downloader() *downloader.Downloader { return s.downloader } +func (s *Ethereum) Downloader() *downloader.Downloader { return s.protocolManager.downloader } // Start the ethereum func (s *Ethereum) Start() error { |