@@ -193,7 +193,6 @@ type Ethereum struct {
193
193
whisper * whisper.Whisper
194
194
pow * ethash.Ethash
195
195
protocolManager * ProtocolManager
196
- downloader * downloader.Downloader
197
196
SolcPath string
198
197
solc * compiler.Solidity
199
198
@@ -290,14 +289,13 @@ func New(config *Config) (*Ethereum, error) {
290
289
if err != nil {
291
290
return nil , err
292
291
}
293
- eth .downloader = downloader .New (eth .EventMux (), eth .chainManager .HasBlock , eth .chainManager .GetBlock )
294
292
eth .txPool = core .NewTxPool (eth .EventMux (), eth .chainManager .State , eth .chainManager .GasLimit )
295
293
eth .blockProcessor = core .NewBlockProcessor (stateDb , extraDb , eth .pow , eth .chainManager , eth .EventMux ())
296
294
eth .chainManager .SetProcessor (eth .blockProcessor )
295
+ eth .protocolManager = NewProtocolManager (config .ProtocolVersion , config .NetworkId , eth .eventMux , eth .txPool , eth .chainManager )
296
+
297
297
eth .miner = miner .New (eth , eth .EventMux (), eth .pow )
298
298
eth .miner .SetGasPrice (config .GasPrice )
299
-
300
- eth .protocolManager = NewProtocolManager (config .ProtocolVersion , config .NetworkId , eth .eventMux , eth .txPool , eth .chainManager , eth .downloader )
301
299
if config .Shh {
302
300
eth .whisper = whisper .New ()
303
301
eth .shhVersionId = int (eth .whisper .Version ())
@@ -447,7 +445,7 @@ func (s *Ethereum) ClientVersion() string { return s.clientVersio
447
445
func (s * Ethereum ) EthVersion () int { return s .ethVersionId }
448
446
func (s * Ethereum ) NetVersion () int { return s .netVersionId }
449
447
func (s * Ethereum ) ShhVersion () int { return s .shhVersionId }
450
- func (s * Ethereum ) Downloader () * downloader.Downloader { return s .downloader }
448
+ func (s * Ethereum ) Downloader () * downloader.Downloader { return s .protocolManager . downloader }
451
449
452
450
// Start the ethereum
453
451
func (s * Ethereum ) Start () error {
0 commit comments