From 2bdb6a14da8d5dc2fc4dc36a20317bb72ee96194 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 22 Nov 2015 18:44:33 +1100 Subject: [PATCH] Expose torrent.Seeding --- t.go | 6 ++++++ 1 file changed, 6 insertions(+) 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) +} -- 2.48.1