Skip to content

Commit

Permalink
update for Nan fancoder#2
Browse files Browse the repository at this point in the history
  • Loading branch information
Olexandr Tarasenkov committed Jan 29, 2018
1 parent 2b2de8f commit 00543d4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ NAN_METHOD(convert_blob) {

Local<Object> target = info[0]->ToObject();
uint64_t mergedMiningBlockVersion = BLOCK_MAJOR_VERSION_2;
if (args.Length() >= 2) {
mergedMiningBlockVersion = static_cast<uint64_t>(args[1]->ToNumber()->NumberValue());
if (info.Length() >= 2) {
mergedMiningBlockVersion = static_cast<uint64_t>(info[1]->ToNumber()->NumberValue());
}

if (!Buffer::HasInstance(target))
Expand Down Expand Up @@ -127,8 +127,8 @@ void get_block_id(const Nan::FunctionCallbackInfo<v8::Value>& info) {

Local<Object> target = info[0]->ToObject();
uint64_t mergedMiningBlockVersion = BLOCK_MAJOR_VERSION_2;
if (args.Length() >= 2) {
mergedMiningBlockVersion = static_cast<uint64_t>(args[1]->ToNumber()->NumberValue());
if (info.Length() >= 2) {
mergedMiningBlockVersion = static_cast<uint64_t>(info[1]->ToNumber()->NumberValue());
}

if (!Buffer::HasInstance(target))
Expand Down Expand Up @@ -161,8 +161,8 @@ void construct_block_blob(const Nan::FunctionCallbackInfo<v8::Value>& info) {
Local<Object> nonce_buf = info[1]->ToObject();

uint64_t mergedMiningBlockVersion = BLOCK_MAJOR_VERSION_2;
if (args.Length() >= 3) {
mergedMiningBlockVersion = static_cast<uint64_t>(args[2]->ToNumber()->NumberValue());
if (info.Length() >= 3) {
mergedMiningBlockVersion = static_cast<uint64_t>(info[2]->ToNumber()->NumberValue());
}

if (!Buffer::HasInstance(block_template_buf) || !Buffer::HasInstance(nonce_buf))
Expand Down

0 comments on commit 00543d4

Please sign in to comment.