Inlineable `(*Torrent).Seeding()` (#626)

This commit is contained in:
YenForYang 2021-09-14 19:28:14 -05:00 committed by GitHub
parent e105d8b57a
commit ebb7160599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

7
t.go
View File

@ -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.