Fix platform.browser.pow
This commit is contained in:
parent
e40a40abd0
commit
3804adea7f
|
@ -70,9 +70,14 @@ exports.pow = function(opts) {
|
|||
|
||||
// Check all input params prematurely to not let promise executor or
|
||||
// worker to fail because of it.
|
||||
assert(poolSize > 0, "Pool size is too low");
|
||||
assert(typeof poolSize === "number", "Bad pool size");
|
||||
assert(poolSize >= 1, "Pool size is too low");
|
||||
assert(poolSize <= 1024, "Pool size is too high");
|
||||
assert(typeof opts.target === "number", "Bad target");
|
||||
assert(opts.target >= 0, "Target is too low");
|
||||
assert(opts.target <= 9007199254740991, "Target is too high");
|
||||
assert(Buffer.isBuffer(opts.initialHash), "Bad initial hash");
|
||||
assert(opts.initialHash.length === 64, "Bad initial hash");
|
||||
|
||||
var cancel;
|
||||
var promise = new Promise(function(resolve, reject) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user