mirror of
https://github.com/logos-storage/bittorrent-tracker.git
synced 2026-01-08 07:53:08 +00:00
Merge pull request #169 from alxhotel/master
Add id parameter in announce calls
This commit is contained in:
commit
8f2e21798c
@ -50,7 +50,7 @@ Swarm.prototype.scrape = function (params, cb) {
|
||||
Swarm.prototype._onAnnounceStarted = function (params, peer, id) {
|
||||
if (peer) {
|
||||
debug('unexpected `started` event from peer that is already in swarm')
|
||||
return this._onAnnounceUpdate(params, peer) // treat as an update
|
||||
return this._onAnnounceUpdate(params, peer, id) // treat as an update
|
||||
}
|
||||
|
||||
if (params.left === 0) this.complete += 1
|
||||
@ -79,7 +79,7 @@ Swarm.prototype._onAnnounceStopped = function (params, peer, id) {
|
||||
Swarm.prototype._onAnnounceCompleted = function (params, peer, id) {
|
||||
if (!peer) {
|
||||
debug('unexpected `completed` event from peer that is not in swarm')
|
||||
return this._onAnnounceStarted(params, peer) // treat as a start
|
||||
return this._onAnnounceStarted(params, peer, id) // treat as a start
|
||||
}
|
||||
if (peer.complete) {
|
||||
debug('unexpected `completed` event from peer that is already marked as completed')
|
||||
@ -95,7 +95,7 @@ Swarm.prototype._onAnnounceCompleted = function (params, peer, id) {
|
||||
Swarm.prototype._onAnnounceUpdate = function (params, peer, id) {
|
||||
if (!peer) {
|
||||
debug('unexpected `update` event from peer that is not in swarm')
|
||||
return this._onAnnounceStarted(params, peer) // treat as a start
|
||||
return this._onAnnounceStarted(params, peer, id) // treat as a start
|
||||
}
|
||||
|
||||
if (!peer.complete && params.left === 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user