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
path: root/docs
diff options
context:
space:
mode:
authorJohn Hiesey <john@hiesey.com>2019-03-20 02:17:14 +0300
committerJohn Hiesey <john@hiesey.com>2019-07-09 05:13:08 +0300
commitae8988848f4328727b321079922a2a5ed735d6ec (patch)
tree7ad865e69489530b2cbc721362c1c57cd2c2e8e5 /docs
parente4b10c20de13b88300a875d6c79a917cfb16c31c (diff)
Add torrent.rescanFiles() to allow manual verify
Useful if files are modified externally to webtorrent.
Diffstat (limited to 'docs')
-rw-r--r--docs/api.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/api.md b/docs/api.md
index 52d1125..66046d0 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -366,6 +366,14 @@ connections, nor does it pause the streams of existing connections or their wire
Resume connecting to new peers.
+## `torrent.rescanFiles([function callback (err) {}])`
+
+Verify the hashes of all pieces in the store and update the bitfield for any new valid
+pieces. Useful if data has been added to the store outside WebTorrent, e.g. if another
+process puts a valid file in the right place. Once the scan is complete,
+`callback(null)` will be called (if provided), unless the torrent was destroyed during
+the scan, in which case `callback` will be called with an error.
+
## `torrent.on('infoHash', function () {})`
Emitted when the info hash of the torrent has been determined.