Skip to content

Commit

Permalink
Torrent.WebseedPeerConns() method (#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Dec 5, 2023
1 parent 59ec9d6 commit 39e605a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions t.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,13 @@ func (t *Torrent) PeerConns() []*PeerConn {
}
return ret
}

func (t *Torrent) WebseedPeerConns() []*Peer {
t.cl.rLock()
defer t.cl.rUnlock()
ret := make([]*Peer, 0, len(t.conns))
for _, c := range t.webSeeds {
ret = append(ret, c)
}
return ret
}

0 comments on commit 39e605a

Please sign in to comment.