aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-25 00:28:46 +0800
committerobscuren <geffobscura@gmail.com>2015-04-25 00:28:46 +0800
commit7ce3d06402d826b8a4cbf8144342d4e94890bcb3 (patch)
tree0f362f0c77416d18b7df422a33b7ae4424be159e /eth
parent405720b218c74ec730541cdcb360db54deb75474 (diff)
downloaddexon-7ce3d06402d826b8a4cbf8144342d4e94890bcb3.tar
dexon-7ce3d06402d826b8a4cbf8144342d4e94890bcb3.tar.gz
dexon-7ce3d06402d826b8a4cbf8144342d4e94890bcb3.tar.bz2
dexon-7ce3d06402d826b8a4cbf8144342d4e94890bcb3.tar.lz
dexon-7ce3d06402d826b8a4cbf8144342d4e94890bcb3.tar.xz
dexon-7ce3d06402d826b8a4cbf8144342d4e94890bcb3.tar.zst
dexon-7ce3d06402d826b8a4cbf8144342d4e94890bcb3.zip
eth/downloader: removed update loop and synch channel
Diffstat (limited to 'eth')
-rw-r--r--eth/downloader/downloader.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go
index 9b8d7c0b2..60d908758 100644
--- a/eth/downloader/downloader.go
+++ b/eth/downloader/downloader.go
@@ -68,10 +68,8 @@ type Downloader struct {
// Channels
newPeerCh chan *peer
- syncCh chan syncPack
hashCh chan []common.Hash
blockCh chan blockPack
- quit chan struct{}
}
func New(hasBlock hashCheckFn, insertChain chainInsertFn) *Downloader {
@@ -81,13 +79,9 @@ func New(hasBlock hashCheckFn, insertChain chainInsertFn) *Downloader {
hasBlock: hasBlock,
insertChain: insertChain,
newPeerCh: make(chan *peer, 1),
- syncCh: make(chan syncPack, 1),
hashCh: make(chan []common.Hash, 1),
blockCh: make(chan blockPack, 1),
- quit: make(chan struct{}),
}
- //go downloader.peerHandler()
- go downloader.update()
return downloader
}
@@ -121,25 +115,6 @@ func (d *Downloader) UnregisterPeer(id string) {
delete(d.peers, id)
}
-func (d *Downloader) update() {
-out:
- for {
- select {
- case sync := <-d.syncCh:
- var peer *peer = sync.peer
- err := d.getFromPeer(peer, sync.hash, sync.ignoreInitial)
- if err != nil {
- glog.V(logger.Detail).Infoln(err)
- break
- }
-
- d.process(peer)
- case <-d.quit:
- break out
- }
- }
-}
-
// SynchroniseWithPeer will select the peer and use it for synchronising. If an empty string is given
// it will use the best peer possible and synchronise if it's TD is higher than our own. If any of the
// checks fail an error will be returned. This method is synchronous