|
|
@ -212,7 +212,7 @@ func (r *sentReq) stateRequesting() reqStateFn { |
|
|
|
// no need to go to stopped state because waiting() already returned false
|
|
|
|
// no need to go to stopped state because waiting() already returned false
|
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
case rpSoftTimeout: |
|
|
|
case rpSoftTimeout, rpDeliveredInvalid: |
|
|
|
// last request timed out, try asking a new peer
|
|
|
|
// last request timed out, try asking a new peer
|
|
|
|
go r.tryRequest() |
|
|
|
go r.tryRequest() |
|
|
|
r.lastReqQueued = true |
|
|
|
r.lastReqQueued = true |
|
|
@ -242,7 +242,11 @@ func (r *sentReq) stateNoMorePeers() reqStateFn { |
|
|
|
r.stop(nil) |
|
|
|
r.stop(nil) |
|
|
|
return r.stateStopped |
|
|
|
return r.stateStopped |
|
|
|
} |
|
|
|
} |
|
|
|
return r.stateNoMorePeers |
|
|
|
if r.waiting() { |
|
|
|
|
|
|
|
return r.stateNoMorePeers |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
r.stop(light.ErrNoPeers) |
|
|
|
|
|
|
|
return nil |
|
|
|
case <-r.stopCh: |
|
|
|
case <-r.stopCh: |
|
|
|
return r.stateStopped |
|
|
|
return r.stateStopped |
|
|
|
} |
|
|
|
} |
|
|
|