From 54b538d3222578d7691f6222b4c5b1b4da93484c Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 7 Feb 2016 21:57:57 +1100 Subject: [PATCH] Export Torrent.PieceState() --- t.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t.go b/t.go index 6bb10711..23e00c00 100644 --- a/t.go +++ b/t.go @@ -53,6 +53,12 @@ func (t Torrent) PieceStateRuns() []PieceStateRun { 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 { -- 2.48.1