Export Torrent.PieceState()
This commit is contained in:
parent
096c870029
commit
54b538d322
6
t.go
6
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user