Skip to content

Commit 30b6f17

Browse files
committed
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
1 parent fb751d7 commit 30b6f17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/client/websocket-tracker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ WebSocketTracker.prototype.announce = function (opts) {
6060
})
6161
if (self._trackerId) params.trackerid = self._trackerId
6262

63-
if (opts.event === 'stopped') {
64-
// Don't include offers with 'stopped' event
63+
if (opts.event === 'stopped' || opts.event === 'completed') {
64+
// Don't include offers with 'stopped' or 'completed' event
6565
self._send(params)
6666
} else {
6767
// Limit the number of offers that are generated, since it can be slow

0 commit comments

Comments
 (0)