Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #290 from bookchin/master
Browse files Browse the repository at this point in the history
v2.0.7
  • Loading branch information
bookchin committed Jul 25, 2016
2 parents 891774e + 6c3b167 commit 91896fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions lib/bridgeclient.js
Expand Up @@ -386,10 +386,11 @@ BridgeClient.prototype._shardUploadWorker = function(task, done) {
}).resume();

task.shard.on('end', task.tmpFile.end.bind(task.tmpFile));
task.tmpFile.on(
'finish',
self._handleShardTmpFileFinish.bind(self, task.state, task.meta, done)
);

task.tmpFile.on('finish', function() {
task.meta.hash = task.meta.hasher.digest('hex');
self._handleShardTmpFileFinish(task.state, task.meta, done);
});
};

/**
Expand All @@ -407,6 +408,7 @@ BridgeClient.prototype._handleShardStream = function(shard, i, frame, state) {
size: 0,
index: i,
hasher: crypto.createHash('sha256'),
hash: null,
excludeFarmers: [],
transferRetries: 0
};
Expand All @@ -431,7 +433,7 @@ BridgeClient.prototype._handleShardStream = function(shard, i, frame, state) {
*/
BridgeClient.prototype._handleShardTmpFileFinish = function(state, meta, done) {
var self = this;
var hash = utils.rmd160(meta.hasher.digest('hex'));
var hash = utils.rmd160(meta.hash);
var auditGenerator = new AuditStream(3);
var shardFile = fs.createReadStream(meta.tmpName);

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "storj",
"version": "2.0.6",
"version": "2.0.7",
"description": "implementation of the storj protocol for node.js and the browser",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 91896fd

Please sign in to comment.