Handle cancelled webseed peer requests if they're not active

This commit is contained in:
Matt Joiner 2021-12-02 13:10:54 +11:00
parent 56bb8a9713
commit 9bee7c3bc4
1 changed files with 6 additions and 6 deletions

View File

@ -50,13 +50,13 @@ func (ws *webseedPeer) _cancel(r RequestIndex) bool {
active, ok := ws.activeRequests[ws.peer.t.requestIndexToRequest(r)]
if ok {
active.Cancel()
}
if !ws.peer.deleteRequest(r) {
panic("cancelled webseed request should exist")
}
if ws.peer.isLowOnRequests() {
ws.peer.updateRequests("webseedPeer._cancel")
}
}
return true
}