Fix naming
This commit is contained in:
parent
53f38be9ed
commit
e562fbf645
|
@ -57,7 +57,7 @@ var FAILBACK_POOL_SIZE = 8;
|
||||||
// <http://caniuse.com/#feat=promises>) and we can use only new browsers
|
// <http://caniuse.com/#feat=promises>) and we can use only new browsers
|
||||||
// because of the WebCryptoAPI (see
|
// because of the WebCryptoAPI (see
|
||||||
// <http://caniuse.com/#feat=cryptography>).
|
// <http://caniuse.com/#feat=cryptography>).
|
||||||
exports.doPOW = function(opts) {
|
exports.pow = function(opts) {
|
||||||
// Try to get CPU cores count otherwise fallback to default value.
|
// Try to get CPU cores count otherwise fallback to default value.
|
||||||
// Currenty navigator's concurrency property available in Chrome and
|
// Currenty navigator's concurrency property available in Chrome and
|
||||||
// not available in Firefox; hope default value won't slow down POW
|
// not available in Firefox; hope default value won't slow down POW
|
||||||
|
|
|
@ -51,7 +51,7 @@ exports.getTarget = function(opts) {
|
||||||
return target;
|
return target;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.doPOW = function(opts) {
|
exports.pow = function(opts) {
|
||||||
var poolSize = opts.poolSize || os.cpus().length;
|
var poolSize = opts.poolSize || os.cpus().length;
|
||||||
|
|
||||||
// Check all input params prematurely to not let promise executor or
|
// Check all input params prematurely to not let promise executor or
|
||||||
|
|
|
@ -91,5 +91,5 @@ exports.do = function(opts) {
|
||||||
initialHash = opts.initialHash;
|
initialHash = opts.initialHash;
|
||||||
}
|
}
|
||||||
opts = objectAssign({}, opts, {initialHash: initialHash});
|
opts = objectAssign({}, opts, {initialHash: initialHash});
|
||||||
return platform.doPOW(opts);
|
return platform.pow(opts);
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "./pow.h"
|
#include "./pow.h"
|
||||||
|
|
||||||
#define MAX_SAFE_JS_INTEGER 9007199254740991
|
#define MAX_SAFE_INTEGER 9007199254740991
|
||||||
|
|
||||||
using node::Buffer;
|
using node::Buffer;
|
||||||
using v8::Handle;
|
using v8::Handle;
|
||||||
|
@ -34,7 +34,7 @@ class PowWorker : public NanAsyncWorker {
|
||||||
// here, so everything we need for input and output
|
// here, so everything we need for input and output
|
||||||
// should go on `this`.
|
// should go on `this`.
|
||||||
void Execute () {
|
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
|
// Executed when the async work is complete
|
||||||
|
|
Loading…
Reference in New Issue
Block a user