Skip to content

Commit

Permalink
fix: DHT cleanup after torrent removal (#2185)
Browse files Browse the repository at this point in the history
Supersedes #1289
  • Loading branch information
DiegoRBaquero authored Sep 2, 2021
1 parent 7b245b5 commit 320541f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ class WebTorrent extends EventEmitter {
if (!torrent) return
this.torrents.splice(this.torrents.indexOf(torrent), 1)
torrent.destroy(opts, cb)
if (this.dht) {
this.dht._tables.remove(torrent.infoHash)
}
}

address () {
Expand Down

0 comments on commit 320541f

Please sign in to comment.