2
0
mirror of synced 2025-02-23 14:18:13 +00:00

Inlineable (*Torrent).AddPeers() (#622)

This commit is contained in:
YenForYang 2021-09-14 19:14:07 -05:00 committed by GitHub
parent a0fe0a087d
commit d00ba917c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
t.go
View File

@ -243,11 +243,11 @@ func (t *Torrent) Files() []*File {
return *t.files
}
func (t *Torrent) AddPeers(pp []PeerInfo) int {
cl := t.cl
cl.lock()
defer cl.unlock()
return t.addPeers(pp)
func (t *Torrent) AddPeers(pp []PeerInfo) (n int) {
t.cl.lock()
n = t.addPeers(pp)
t.cl.unlock()
return
}
// Marks the entire torrent for download. Requires the info first, see