hyperdrive
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -177,2 +177,3 @@ var events = require('events') | ||
var top = hash.data(data) | ||
var batch = [] | ||
var want = 2 * block | ||
@@ -189,2 +190,3 @@ var offset = 0 | ||
batch.push({type: 'put', key: self.prefix + digest.index, value: digest.hash}) | ||
hashes.get(this.prefix + want, loop) | ||
@@ -216,11 +218,2 @@ | ||
if (want === digest.index) return write(null) | ||
var batch = new Array(1 + offset) | ||
var i = 0 | ||
batch[i++] = {type: 'put', key: self.prefix + digest.index, value: digest.hash} | ||
for (i = 0; i < offset; i++) { | ||
var next = proof[i] | ||
batch[i + 1] = {type: 'put', key: self.prefix + next.index, value: next.hash} | ||
} | ||
hashes.batch(batch, write) | ||
@@ -237,2 +230,3 @@ } | ||
if (offset < proof.length && proof[offset].index === sibling) { | ||
batch.push({type: 'put', key: self.prefix + proof[offset].index, value: proof[offset].hash}) | ||
next(null, proof[offset++].hash) | ||
@@ -248,2 +242,3 @@ } else { | ||
else top = hash.tree(top, sibling) | ||
batch.push({type: 'put', key: self.prefix + want, value: top}) | ||
hashes.get(self.prefix + want, loop) | ||
@@ -250,0 +245,0 @@ } |
@@ -157,2 +157,9 @@ var protocol = require('./protocol') | ||
else top = hash.tree(top, sibling) | ||
batch.push({ | ||
type: 'put', | ||
key: ptr + want, | ||
value: top | ||
}) | ||
getHash(want, loop) | ||
@@ -159,0 +166,0 @@ } |
{ | ||
"name": "hyperdrive", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A file sharing network based on rabin file chunking and append only feeds of data verified by merkle trees.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46341
17
1322