From d5026b5684748ca1a40ea2d29edce08fe7a803ad Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 29 May 2025 18:42:47 +1000 Subject: [PATCH] Panic if request piece being marked --- peer.go | 4 ++++ 1 file changed, 4 insertions(+) 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") } -- 2.51.0