From: YenForYang Date: Wed, 15 Sep 2021 00:28:14 +0000 (-0500) Subject: Inlineable `(*Torrent).Seeding()` (#626) X-Git-Tag: v1.32.0~54 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ebb71605991b1b5fa94a760a448c9b2b49f01ec4;p=btrtrc.git Inlineable `(*Torrent).Seeding()` (#626) --- diff --git a/t.go b/t.go index 5fa9f3dd..2c076386 100644 --- a/t.go +++ b/t.go @@ -124,10 +124,11 @@ func (t *Torrent) SubscribePieceStateChanges() *pubsub.Subscription { // Returns true if the torrent is currently being seeded. This occurs when the // client is willing to upload without wanting anything in return. -func (t *Torrent) Seeding() bool { +func (t *Torrent) Seeding() (ret bool) { t.cl.lock() - defer t.cl.unlock() - return t.seeding() + ret = t.seeding() + t.cl.unlock() + return } // Clobbers the torrent display name if metainfo is unavailable.