From: Matt Joiner Date: Thu, 29 May 2025 08:42:47 +0000 (+1000) Subject: Panic if request piece being marked X-Git-Tag: v1.59.0~95 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d5026b5684748ca1a40ea2d29edce08fe7a803ad;p=btrtrc.git Panic if request piece being marked --- diff --git a/peer.go b/peer.go index 988eb07b..a7e94ae7 100644 --- a/peer.go +++ b/peer.go @@ -436,6 +436,10 @@ func (cn *Peer) shouldRequest(r RequestIndex) error { if cn.t.hashingPiece(pi) { panic("piece is being hashed") } + p := cn.t.piece(pi) + if p.marking { + panic("piece is being marked") + } if cn.t.pieceQueuedForHash(pi) { panic("piece is queued for hash") }