]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Expose torrent.Seeding
authorMatt Joiner <anacrolix@gmail.com>
Sun, 22 Nov 2015 07:44:33 +0000 (18:44 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 22 Nov 2015 07:44:33 +0000 (18:44 +1100)
t.go

diff --git a/t.go b/t.go
index fcb57740f7287cc9367c7b329a47014e6be09a55..5abb91697ae661e47602c9d68288cb7edd62c8f7 100644 (file)
--- 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)
+}