Skip to content

Commit

Permalink
only set latest for downloaders (#126)
Browse files Browse the repository at this point in the history
* only set latest for downloaders

* also set in onindex
  • Loading branch information
joehand authored and mafintosh committed Feb 18, 2017
1 parent 39c2307 commit 6266d63
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function Archive (drive, key, opts) {
this.open = thunky(open)
this.id = drive.id

this._onlyLatest = !!opts.file
this._onlyLatest = !!opts.file && !this.owner
this._sparse = !!this.options.sparse
this._closed = false
this._appending = []
Expand Down Expand Up @@ -573,7 +573,10 @@ Archive.prototype._open = function (cb) {
if (err) return cb(err)
if (self._closed) return cb(new Error('Archive is closed'))

if (!self.owner && self.metadata.secretKey) self.owner = true // TODO: hypercore should tell you this
if (!self.owner && self.metadata.secretKey) {
self.owner = true // TODO: hypercore should tell you this
self._onlyLatest = false
}

if (!self.owner || self.metadata.blocks) waitForIndex(null)
else onindex(null)
Expand Down

0 comments on commit 6266d63

Please sign in to comment.