diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-15 22:43:37 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-15 22:43:37 +0800 |
commit | 263903378b81f4a17ab34f5ad0d3a7ceb2b5dea9 (patch) | |
tree | 730df04d1439ddc089798a9da5b00ab849b95494 /eth/backend.go | |
parent | 6f5c6150b7060b6b2ee68ac95b30f46c5c2c7f90 (diff) | |
parent | aa250e228a7f2eec5d512d05eb042b75e2755d30 (diff) | |
download | dexon-263903378b81f4a17ab34f5ad0d3a7ceb2b5dea9.tar dexon-263903378b81f4a17ab34f5ad0d3a7ceb2b5dea9.tar.gz dexon-263903378b81f4a17ab34f5ad0d3a7ceb2b5dea9.tar.bz2 dexon-263903378b81f4a17ab34f5ad0d3a7ceb2b5dea9.tar.lz dexon-263903378b81f4a17ab34f5ad0d3a7ceb2b5dea9.tar.xz dexon-263903378b81f4a17ab34f5ad0d3a7ceb2b5dea9.tar.zst dexon-263903378b81f4a17ab34f5ad0d3a7ceb2b5dea9.zip |
Merge pull request #1243 from karalabe/instrument-downloader-sync
eth, eth/downloader: separate concerns, clean up test suite
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 { |