From 886f242c757a84f1ba9e736c1fa2b53f7a03f148 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 14 Jul 2025 15:38:41 +1000 Subject: [PATCH] Panic on unhandled completion error --- torrent.go | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.51.0