aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-10-28 22:41:01 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-10-28 22:41:01 +0800
commit2019ed71b4758956a8bd9671c73ba98a244f4a7b (patch)
tree569c1bd3051eab38d5a82415c331d0ca7d5ad952 /eth/downloader
parent6b5a42a15ca54749d41c0b29b4a26ebb3a1a53f0 (diff)
downloaddexon-2019ed71b4758956a8bd9671c73ba98a244f4a7b.tar
dexon-2019ed71b4758956a8bd9671c73ba98a244f4a7b.tar.gz
dexon-2019ed71b4758956a8bd9671c73ba98a244f4a7b.tar.bz2
dexon-2019ed71b4758956a8bd9671c73ba98a244f4a7b.tar.lz
dexon-2019ed71b4758956a8bd9671c73ba98a244f4a7b.tar.xz
dexon-2019ed71b4758956a8bd9671c73ba98a244f4a7b.tar.zst
dexon-2019ed71b4758956a8bd9671c73ba98a244f4a7b.zip
eth: don't block sync goroutines that short circuit
Diffstat (limited to 'eth/downloader')
-rw-r--r--eth/downloader/downloader.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go
index 4bcbd8557..153427ee4 100644
--- a/eth/downloader/downloader.go
+++ b/eth/downloader/downloader.go
@@ -248,10 +248,11 @@ func (d *Downloader) UnregisterPeer(id string) error {
// Synchronise tries to sync up our local block chain with a remote peer, both
// adding various sanity checks as well as wrapping it with various log entries.
-func (d *Downloader) Synchronise(id string, head common.Hash, td *big.Int, mode SyncMode) {
+func (d *Downloader) Synchronise(id string, head common.Hash, td *big.Int, mode SyncMode) error {
glog.V(logger.Detail).Infof("Attempting synchronisation: %v, head [%x…], TD %v", id, head[:4], td)
- switch err := d.synchronise(id, head, td, mode); err {
+ err := d.synchronise(id, head, td, mode)
+ switch err {
case nil:
glog.V(logger.Detail).Infof("Synchronisation completed")
@@ -268,6 +269,7 @@ func (d *Downloader) Synchronise(id string, head common.Hash, td *big.Int, mode
default:
glog.V(logger.Warn).Infof("Synchronisation failed: %v", err)
}
+ return err
}
// synchronise will select the peer and use it for synchronising. If an empty string is given