aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/downloader.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-05-11 22:06:42 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-05-11 22:10:00 +0800
commitfa53c5e0747925e065ca968c1cca9c974f40dc6b (patch)
treeb75a2f6dfb0d1258d993fe7e4a9874f09d2f911b /eth/downloader/downloader.go
parentebbd8b0743f9639ebf2b23ed04946cc20a83ff6e (diff)
downloaddexon-fa53c5e0747925e065ca968c1cca9c974f40dc6b.tar
dexon-fa53c5e0747925e065ca968c1cca9c974f40dc6b.tar.gz
dexon-fa53c5e0747925e065ca968c1cca9c974f40dc6b.tar.bz2
dexon-fa53c5e0747925e065ca968c1cca9c974f40dc6b.tar.lz
dexon-fa53c5e0747925e065ca968c1cca9c974f40dc6b.tar.xz
dexon-fa53c5e0747925e065ca968c1cca9c974f40dc6b.tar.zst
dexon-fa53c5e0747925e065ca968c1cca9c974f40dc6b.zip
eth/downloader: use count instead of peers, clearer
Diffstat (limited to 'eth/downloader/downloader.go')
-rw-r--r--eth/downloader/downloader.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go
index 5e9931f59..4c7ebe646 100644
--- a/eth/downloader/downloader.go
+++ b/eth/downloader/downloader.go
@@ -363,7 +363,7 @@ out:
}
}
// After removing bad peers make sure we actually have sufficient peer left to keep downloading
- if d.peers.Peers() == 0 {
+ if d.peers.Len() == 0 {
d.queue.Reset()
return errNoPeers
}
@@ -400,7 +400,7 @@ out:
if d.queue.InFlight() == 0 {
d.queue.Reset()
- return fmt.Errorf("%v peers available = %d. total peers = %d. hashes needed = %d", errPeersUnavailable, len(idlePeers), d.peers.Peers(), d.queue.Pending())
+ return fmt.Errorf("%v peers available = %d. total peers = %d. hashes needed = %d", errPeersUnavailable, len(idlePeers), d.peers.Len(), d.queue.Pending())
}
} else if d.queue.InFlight() == 0 {