From: Matt Joiner Date: Mon, 14 Jul 2025 05:38:41 +0000 (+1000) Subject: Panic on unhandled completion error X-Git-Tag: v1.59.0~21 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=886f242c757a84f1ba9e736c1fa2b53f7a03f148;p=btrtrc.git Panic on unhandled completion error --- diff --git a/torrent.go b/torrent.go index c2407696..6b2ba6b0 100644 --- a/torrent.go +++ b/torrent.go @@ -1681,6 +1681,9 @@ func (t *Torrent) openNewConns() (initiated int) { func (t *Torrent) updatePieceCompletion(piece pieceIndex) bool { p := t.piece(piece) uncached := t.pieceCompleteUncached(piece) + // This isn't being handled. Here we should probably be storing Option[bool] for completion and + // filtering out errors. Also, errors should probably disable downloading here too. + panicif.Err(uncached.Err) cached := p.completion() changed := cached != uncached complete := uncached.Ok && uncached.Complete