diff --git a/lib/platform.browser.js b/lib/platform.browser.js index 197e023..e132198 100644 --- a/lib/platform.browser.js +++ b/lib/platform.browser.js @@ -57,7 +57,7 @@ var FAILBACK_POOL_SIZE = 8; // ) and we can use only new browsers // because of the WebCryptoAPI (see // ). -exports.doPOW = function(opts) { +exports.pow = function(opts) { // Try to get CPU cores count otherwise fallback to default value. // Currenty navigator's concurrency property available in Chrome and // not available in Firefox; hope default value won't slow down POW diff --git a/lib/platform.js b/lib/platform.js index c54a9f7..3a7fc3d 100644 --- a/lib/platform.js +++ b/lib/platform.js @@ -51,7 +51,7 @@ exports.getTarget = function(opts) { return target; }; -exports.doPOW = function(opts) { +exports.pow = function(opts) { var poolSize = opts.poolSize || os.cpus().length; // Check all input params prematurely to not let promise executor or diff --git a/lib/pow.js b/lib/pow.js index eb6b347..c0ad44c 100644 --- a/lib/pow.js +++ b/lib/pow.js @@ -91,5 +91,5 @@ exports.do = function(opts) { initialHash = opts.initialHash; } opts = objectAssign({}, opts, {initialHash: initialHash}); - return platform.doPOW(opts); + return platform.pow(opts); }; diff --git a/src/worker.cc b/src/worker.cc index 6c938ba..9a29a6a 100644 --- a/src/worker.cc +++ b/src/worker.cc @@ -3,7 +3,7 @@ #include #include "./pow.h" -#define MAX_SAFE_JS_INTEGER 9007199254740991 +#define MAX_SAFE_INTEGER 9007199254740991 using node::Buffer; using v8::Handle; @@ -34,7 +34,7 @@ class PowWorker : public NanAsyncWorker { // here, so everything we need for input and output // should go on `this`. void Execute () { - error = pow(pool_size, target, initial_hash, MAX_SAFE_JS_INTEGER, &nonce); + error = pow(pool_size, target, initial_hash, MAX_SAFE_INTEGER, &nonce); } // Executed when the async work is complete