From: Matt Joiner Date: Thu, 2 Dec 2021 02:10:54 +0000 (+1100) Subject: Handle cancelled webseed peer requests if they're not active X-Git-Tag: v1.39.0~31 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=9bee7c3bc4986b9f9a94eb969db20468c7d9abde;p=btrtrc.git Handle cancelled webseed peer requests if they're not active --- diff --git a/webseed-peer.go b/webseed-peer.go index 682bef35..cea3f9de 100644 --- a/webseed-peer.go +++ b/webseed-peer.go @@ -50,12 +50,12 @@ 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") - } + } + if !ws.peer.deleteRequest(r) { + panic("cancelled webseed request should exist") + } + if ws.peer.isLowOnRequests() { + ws.peer.updateRequests("webseedPeer._cancel") } return true }