From 84b94fd1b5d030e81b97af4774bd18f2e6e16bf7 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 15 Jul 2016 08:39:30 -0700 Subject: [PATCH] fix scrypt worker. --- lib/bcoin/hd.js | 4 ++-- lib/bcoin/workers.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/bcoin/hd.js b/lib/bcoin/hd.js index 48cee117..8d6e97c5 100644 --- a/lib/bcoin/hd.js +++ b/lib/bcoin/hd.js @@ -1200,7 +1200,7 @@ HDPrivateKey.prototype.fromSeed = function fromSeed(seed, network) { this.childIndex = 0; this.chainCode = right; this.privateKey = left; - this.publicKey = ec.publicKeyCreate(this.privateKey, true); + this.publicKey = ec.publicKeyCreate(left, true); return this; }; @@ -1259,7 +1259,7 @@ HDPrivateKey.prototype.fromKey = function fromKey(key, entropy, network) { this.childIndex = 0; this.chainCode = entropy; this.privateKey = key; - this.publicKey = ec.publicKeyCreate(this.privateKey, true); + this.publicKey = ec.publicKeyCreate(key, true); return this; }; diff --git a/lib/bcoin/workers.js b/lib/bcoin/workers.js index 13f2170c..52be54c5 100644 --- a/lib/bcoin/workers.js +++ b/lib/bcoin/workers.js @@ -329,7 +329,7 @@ function Worker(id) { this.child.onerror = function onerror(err) { self.emit('error', err); - self.emit('exit', 1, null); + self.emit('exit', -1, null); }; this.child.onmessage = function onmessage(event) { @@ -802,7 +802,7 @@ jobs.mine = function mine(attempt) { jobs.scrypt = function scrypt(passwd, salt, N, r, p, len) { var scrypt = require('./scrypt'); - return scrypt(passwd, salt, N, r, p, len); + return scrypt(passwd, salt, N >>> 0, r >>> 0, p >>> 0, len); }; /**