From ebb71605991b1b5fa94a760a448c9b2b49f01ec4 Mon Sep 17 00:00:00 2001 From: YenForYang Date: Tue, 14 Sep 2021 19:28:14 -0500 Subject: [PATCH] Inlineable `(*Torrent).Seeding()` (#626) --- t.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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. -- 2.48.1