mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-31 10:31:36 +00:00
ws client: Don't include offers with 'completed' event
It's not necessary to include webrtc offers because the client is not really looking for more peers when it has just completed the torrent. Fewer WebRTC offers = less resource usage
This commit is contained in:
parent
fb751d7c96
commit
30b6f176b1
@ -60,8 +60,8 @@ WebSocketTracker.prototype.announce = function (opts) {
|
||||
})
|
||||
if (self._trackerId) params.trackerid = self._trackerId
|
||||
|
||||
if (opts.event === 'stopped') {
|
||||
// Don't include offers with 'stopped' event
|
||||
if (opts.event === 'stopped' || opts.event === 'completed') {
|
||||
// Don't include offers with 'stopped' or 'completed' event
|
||||
self._send(params)
|
||||
} else {
|
||||
// Limit the number of offers that are generated, since it can be slow
|
||||
|
Loading…
Reference in New Issue
Block a user