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:
authorFeross Aboukhadijeh <feross@feross.org>2021-03-06 05:04:43 +0300
committerGitHub <noreply@github.com>2021-03-06 05:04:43 +0300
commit3c6f41c5fa1c14a92ee39a5e03cc31a1cffcc841 (patch)
treede51ae5ce49ff64ab4259cd17ed16fcac6dad661
parent3186060eea5952ff81e8185810f105c40ca81a53 (diff)
parent860a4ce1812dcc25c9876587619de61eb48b26e4 (diff)
Merge pull request #2013 from jhiesey/destroy-on-store-error
Destroy torrent if putting into store fails
-rw-r--r--lib/torrent.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index 930304f..3760db2 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -1599,7 +1599,9 @@ class Torrent extends EventEmitter {
self._reservations[index] = null
self.bitfield.set(index, true)
- self.store.put(index, buf)
+ self.store.put(index, buf, err => {
+ if (err) self._destroy(err)
+ })
self.wires.forEach(wire => {
wire.have(index)