Fix for nan 1.5
This commit is contained in:
parent
6faae5fcf4
commit
ecdcd30a76
|
@ -3,7 +3,7 @@
|
||||||
{
|
{
|
||||||
"target_name": "worker",
|
"target_name": "worker",
|
||||||
"include_dirs": ["<!(node -e \"require('nan')\")"],
|
"include_dirs": ["<!(node -e \"require('nan')\")"],
|
||||||
"cflags": ["-Wall", "-O2"],
|
"cflags": ["-Wall", "-Wextra", "-O2"],
|
||||||
"sources": ["src/worker.cc", "src/pow.cc"],
|
"sources": ["src/worker.cc", "src/pow.cc"],
|
||||||
"conditions": [
|
"conditions": [
|
||||||
["OS=='win'", {
|
["OS=='win'", {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef BITMESSAGE_POW_H
|
#ifndef BITCHAN_BITMESSAGE_POW_H_
|
||||||
#define BITMESSAGE_POW_H
|
#define BITCHAN_BITMESSAGE_POW_H_
|
||||||
|
|
||||||
static const int MAX_POOL_SIZE = 1024;
|
static const int MAX_POOL_SIZE = 1024;
|
||||||
static const int HASH_SIZE = 64;
|
static const int HASH_SIZE = 64;
|
||||||
|
@ -10,4 +10,4 @@ int pow(size_t pool_size,
|
||||||
uint64_t max_nonce,
|
uint64_t max_nonce,
|
||||||
uint64_t* nonce);
|
uint64_t* nonce);
|
||||||
|
|
||||||
#endif
|
#endif // BITCHAN_BITMESSAGE_POW_H_
|
||||||
|
|
|
@ -10,7 +10,7 @@ using v8::Function;
|
||||||
using v8::Value;
|
using v8::Value;
|
||||||
using v8::Object;
|
using v8::Object;
|
||||||
using v8::String;
|
using v8::String;
|
||||||
using v8::Integer;
|
using v8::Number;
|
||||||
|
|
||||||
static const uint64_t MAX_SAFE_INTEGER = 9007199254740991ULL;
|
static const uint64_t MAX_SAFE_INTEGER = 9007199254740991ULL;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class PowWorker : public NanAsyncWorker {
|
||||||
}
|
}
|
||||||
callback->Call(1, argv);
|
callback->Call(1, argv);
|
||||||
} else {
|
} else {
|
||||||
Local<Value> argv[] = {NanNull(), NanNew<Integer>(nonce)};
|
Local<Value> argv[] = {NanNull(), NanNew<Number>(nonce)};
|
||||||
callback->Call(2, argv);
|
callback->Call(2, argv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user