From: Matt Joiner Date: Sun, 22 Nov 2015 07:44:33 +0000 (+1100) Subject: Expose torrent.Seeding X-Git-Tag: v1.0.0~982 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=2bdb6a14da8d5dc2fc4dc36a20317bb72ee96194;p=btrtrc.git Expose torrent.Seeding --- diff --git a/t.go b/t.go index fcb57740..5abb9169 100644 --- a/t.go +++ b/t.go @@ -74,3 +74,9 @@ func (t Torrent) BytesCompleted() int64 { func (t Torrent) SubscribePieceStateChanges() *pubsub.Subscription { return t.torrent.pieceStateChanges.Subscribe() } + +func (t Torrent) Seeding() bool { + t.cl.mu.Lock() + defer t.cl.mu.Unlock() + return t.cl.seeding(t.torrent) +}