aboutsummaryrefslogtreecommitdiffstats
path: root/les
diff options
context:
space:
mode:
authorFelföldi Zsolt <zsfelfoldi@gmail.com>2018-09-20 15:46:39 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-09-20 15:46:39 +0800
commitc37238cae9b83aff0fc2413b3bb37f847c7949d6 (patch)
tree8952ba971fc95c1c165276a18aaa95916643dbbf /les
parentda29332c5f4c368ff03ec4e7132eefac48fed1ae (diff)
downloaddexon-c37238cae9b83aff0fc2413b3bb37f847c7949d6.tar.gz
dexon-c37238cae9b83aff0fc2413b3bb37f847c7949d6.tar.zst
dexon-c37238cae9b83aff0fc2413b3bb37f847c7949d6.zip
les: fix retriever logic (#17705)
Diffstat (limited to 'les')
-rw-r--r--les/retrieve.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/les/retrieve.go b/les/retrieve.go
index 8ae36d82c..c3d788813 100644
--- a/les/retrieve.go
+++ b/les/retrieve.go
@@ -212,7 +212,7 @@ func (r *sentReq) stateRequesting() reqStateFn {
// no need to go to stopped state because waiting() already returned false
return nil
}
- case rpSoftTimeout:
+ case rpSoftTimeout, rpDeliveredInvalid:
// last request timed out, try asking a new peer
go r.tryRequest()
r.lastReqQueued = true
@@ -242,7 +242,11 @@ func (r *sentReq) stateNoMorePeers() reqStateFn {
r.stop(nil)
return r.stateStopped
}
- return r.stateNoMorePeers
+ if r.waiting() {
+ return r.stateNoMorePeers
+ }
+ r.stop(light.ErrNoPeers)
+ return nil
case <-r.stopCh:
return r.stateStopped
}