Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defer Store Verification #1350

Open
wants to merge 5 commits into
base: master
from
Open
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

rename _markVerified() to _markInStore()

This avoids confusion with setting an index in _verified[] to true.
  • Loading branch information
KayleePop committed Apr 11, 2018
commit 9249d80eb9002bbca140381dabe72a920bace817
@@ -548,7 +548,7 @@ Torrent.prototype._onMetadata = function (metadata) {

if (unchanged) {
for (var index = 0; index < self.pieces.length; index++) {
self._markVerified(index)
self._markInStore(index)
}
} else {
self._verifyPieces()
@@ -626,7 +626,7 @@ Torrent.prototype._verify = function (index, cb) {

if (hash === self._hashes[index]) {
self._debug('piece verified %s', index)
self._markVerified(index)
self._markInStore(index)

self.wires.forEach(function (wire) {
wire.have(index)
@@ -649,7 +649,7 @@ Torrent.prototype._verify = function (index, cb) {
})
}

Torrent.prototype._markVerified = function (index) {
Torrent.prototype._markInStore = function (index) {
this.pieces[index] = null
this._reservations[index] = null
this.bitfield.set(index, true)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.