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/handler.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/handler.go')
-rw-r--r-- | eth/handler.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/eth/handler.go b/eth/handler.go index f002727f3..ac7fb8fcf 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -68,12 +68,11 @@ type ProtocolManager struct { // NewProtocolManager returns a new ethereum sub protocol manager. The Ethereum sub protocol manages peers capable // with the ethereum network. -func NewProtocolManager(protocolVersion, networkId int, mux *event.TypeMux, txpool txPool, chainman *core.ChainManager, downloader *downloader.Downloader) *ProtocolManager { +func NewProtocolManager(protocolVersion, networkId int, mux *event.TypeMux, txpool txPool, chainman *core.ChainManager) *ProtocolManager { manager := &ProtocolManager{ eventMux: mux, txpool: txpool, chainman: chainman, - downloader: downloader, peers: newPeerSet(), newPeerCh: make(chan *peer, 1), newHashCh: make(chan []*blockAnnounce, 1), @@ -81,6 +80,7 @@ func NewProtocolManager(protocolVersion, networkId int, mux *event.TypeMux, txpo txsyncCh: make(chan *txsync), quitSync: make(chan struct{}), } + manager.downloader = downloader.New(manager.eventMux, manager.chainman.HasBlock, manager.chainman.GetBlock, manager.removePeer) manager.SubProtocol = p2p.Protocol{ Name: "eth", Version: uint(protocolVersion), |