diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-08-24 00:39:55 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-08-24 00:39:55 +0300 |
commit | 37c0a65ccda91e2e2d24bc484b04a7d63df848d7 (patch) | |
tree | 81e00871ef3ca6ad5646bada586b61d920c81752 | |
parent | 2a969b9a2d27dd7a88c0881229438833a9cc186f (diff) |
torrent.load should cancel reservations
-rw-r--r-- | lib/torrent.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 9562aa6..6595043 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1108,8 +1108,8 @@ Torrent.prototype._request = function (wire, index, hotswap) { self.pieces[index] = null self._reservations[index] = null - self.bitfield.set(index, true) + self.store.put(index, buf) self.swarm.wires.forEach(function (wire) { @@ -1169,6 +1169,7 @@ Torrent.prototype.load = function (streams, cb) { if (err) return cb(err) self.pieces.forEach(function (piece, index) { self.pieces[index] = null + self._reservations[index] = null self.bitfield.set(index, true) }) self._onPiece() |