t.go | 6 ++++++ diff --git a/t.go b/t.go index 6bb1071109c2326df8c36d3ce23110ed76ff76c6..23e00c002def6a12c97224a4056a99c01bdf11b9 100644 --- a/t.go +++ b/t.go @@ -53,6 +53,12 @@ defer t.torrent.stateMu.Unlock() return t.torrent.pieceStateRuns() } +func (t Torrent) PieceState(piece int) PieceState { + t.torrent.stateMu.Lock() + defer t.torrent.stateMu.Unlock() + return t.torrent.pieceState(piece) +} + // The number of pieces in the torrent. This requires that the info has been // obtained first. func (t Torrent) NumPieces() int {