Fix panic in webseeds updating requests when Torrent is closed

I think this was caused by PieceRequestOrder being removed if all pieces in a storage capacity key are deleted.
This commit is contained in:
Matt Joiner 2021-12-20 14:32:37 +11:00
parent 7772d50f74
commit 9739afce93
1 changed files with 3 additions and 0 deletions

View File

@ -154,6 +154,9 @@ func (p *Peer) getDesiredRequestState() (desired desiredRequestState) {
if !p.t.haveInfo() {
return
}
if p.t.closed.IsSet() {
return
}
input := p.t.getRequestStrategyInput()
requestHeap := peerRequests{
peer: p,