Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/index.js b/index.js
index 3e07d04..26bf323 100644
--- a/index.js
+++ b/index.js
@@ -393,7 +393,9 @@ class WebTorrent extends EventEmitter {
const existingTorrent = this.get(torrentBuf)
if (existingTorrent) {
- torrent._destroy(new Error(`Cannot add duplicate torrent ${existingTorrent.infoHash}`))
+ console.warn('A torrent with the same id is already being seeded')
+ torrent._destroy()
+ if (typeof onseed === 'function') onseed(existingTorrent)
} else {
torrent._onTorrentId(torrentBuf)
}