diff options
Diffstat (limited to 'eth/backend.go')
-rw-r--r-- | eth/backend.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/eth/backend.go b/eth/backend.go index 28640b63d..c5fa328b0 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -219,15 +219,17 @@ func New(config *Config) (*Ethereum, error) { } eth.chainManager = core.NewChainManager(blockDb, stateDb, eth.EventMux()) - eth.downloader = downloader.New(eth.chainManager.HasBlock, eth.chainManager.InsertChain, eth.chainManager.Td) + eth.downloader = downloader.New(eth.chainManager.HasBlock, eth.chainManager.InsertChain) eth.pow = ethash.New(eth.chainManager) - eth.txPool = core.NewTxPool(eth.EventMux(), eth.chainManager.State) + eth.txPool = core.NewTxPool(eth.EventMux(), eth.chainManager.State, eth.chainManager.GasLimit) eth.blockProcessor = core.NewBlockProcessor(stateDb, extraDb, eth.pow, eth.txPool, eth.chainManager, eth.EventMux()) eth.chainManager.SetProcessor(eth.blockProcessor) - eth.whisper = whisper.New() - eth.shhVersionId = int(eth.whisper.Version()) eth.miner = miner.New(eth, eth.pow, config.MinerThreads) 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()) + } netprv, err := config.nodeKey() if err != nil { @@ -325,10 +327,9 @@ func (s *Ethereum) StartMining() error { err = fmt.Errorf("Cannot start mining without etherbase address: %v", err) glog.V(logger.Error).Infoln(err) return err - } - s.miner.Start(eb) + go s.miner.Start(eb) return nil } |