-
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,8 +180,15 @@ var torrentStream = function(link, opts, cb) { | |
}); | ||
|
||
if (prev === engine.amInterested) return; | ||
if (engine.amInterested) engine.emit('interested'); | ||
else engine.emit('uninterested'); | ||
if (engine.amInterested) { | ||
engine.emit('interested'); | ||
if (swarm.paused) { | ||
swarm.resume(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
asapach
Author
Collaborator
|
||
discovery.restart(); | ||
} | ||
} else { | ||
engine.emit('uninterested'); | ||
} | ||
}; | ||
|
||
var gc = function() { | ||
|
@@ -581,15 +588,11 @@ var torrentStream = function(link, opts, cb) { | |
if (engine.bitfield) wire.bitfield(engine.bitfield); | ||
}); | ||
|
||
swarm.pause(); | ||
|
||
if (link.files && engine.metadata) { | ||
swarm.resume(); | ||
ontorrent(link); | ||
} else { | ||
fs.readFile(torrentPath, function(_, buf) { | ||
if (destroyed) return; | ||
swarm.resume(); | ||
This comment has been minimized.
Sorry, something went wrong.
jaruba
Contributor
|
||
|
||
// We know only infoHash here, not full infoDictionary. | ||
// But infoHash is enough to connect to trackers and get peers. | ||
|
Why use
swarm.resume()
here? From what I can tellpeer-wire-swarm
resumes anyway.