diff --git a/lib/torrent.js b/lib/torrent.js index 1ab3eb82..d8a96eb6 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -514,6 +514,9 @@ Torrent.prototype._onWireWithMetadata = function (wire) { wire.on('close', function () { clearTimeout(timeoutId) + wire.requests.forEach(function (req) { + self.storage.cancelBlock(req.piece, req.offset) + }) }) wire.on('choke', function () {