fix scrypt worker.

This commit is contained in:
Christopher Jeffrey 2016-07-15 08:39:30 -07:00
parent b81a6b3ea1
commit 84b94fd1b5
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 4 additions and 4 deletions

View File

@ -1200,7 +1200,7 @@ HDPrivateKey.prototype.fromSeed = function fromSeed(seed, network) {
this.childIndex = 0; this.childIndex = 0;
this.chainCode = right; this.chainCode = right;
this.privateKey = left; this.privateKey = left;
this.publicKey = ec.publicKeyCreate(this.privateKey, true); this.publicKey = ec.publicKeyCreate(left, true);
return this; return this;
}; };
@ -1259,7 +1259,7 @@ HDPrivateKey.prototype.fromKey = function fromKey(key, entropy, network) {
this.childIndex = 0; this.childIndex = 0;
this.chainCode = entropy; this.chainCode = entropy;
this.privateKey = key; this.privateKey = key;
this.publicKey = ec.publicKeyCreate(this.privateKey, true); this.publicKey = ec.publicKeyCreate(key, true);
return this; return this;
}; };

View File

@ -329,7 +329,7 @@ function Worker(id) {
this.child.onerror = function onerror(err) { this.child.onerror = function onerror(err) {
self.emit('error', err); self.emit('error', err);
self.emit('exit', 1, null); self.emit('exit', -1, null);
}; };
this.child.onmessage = function onmessage(event) { 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) { jobs.scrypt = function scrypt(passwd, salt, N, r, p, len) {
var scrypt = require('./scrypt'); var scrypt = require('./scrypt');
return scrypt(passwd, salt, N, r, p, len); return scrypt(passwd, salt, N >>> 0, r >>> 0, p >>> 0, len);
}; };
/** /**