diff --git a/src/main.cc b/src/main.cc index 4a14232f..8918d214 100644 --- a/src/main.cc +++ b/src/main.cc @@ -87,8 +87,8 @@ NAN_METHOD(convert_blob) { Local target = info[0]->ToObject(); uint64_t mergedMiningBlockVersion = BLOCK_MAJOR_VERSION_2; - if (args.Length() >= 2) { - mergedMiningBlockVersion = static_cast(args[1]->ToNumber()->NumberValue()); + if (info.Length() >= 2) { + mergedMiningBlockVersion = static_cast(info[1]->ToNumber()->NumberValue()); } if (!Buffer::HasInstance(target)) @@ -127,8 +127,8 @@ void get_block_id(const Nan::FunctionCallbackInfo& info) { Local target = info[0]->ToObject(); uint64_t mergedMiningBlockVersion = BLOCK_MAJOR_VERSION_2; - if (args.Length() >= 2) { - mergedMiningBlockVersion = static_cast(args[1]->ToNumber()->NumberValue()); + if (info.Length() >= 2) { + mergedMiningBlockVersion = static_cast(info[1]->ToNumber()->NumberValue()); } if (!Buffer::HasInstance(target)) @@ -161,8 +161,8 @@ void construct_block_blob(const Nan::FunctionCallbackInfo& info) { Local nonce_buf = info[1]->ToObject(); uint64_t mergedMiningBlockVersion = BLOCK_MAJOR_VERSION_2; - if (args.Length() >= 3) { - mergedMiningBlockVersion = static_cast(args[2]->ToNumber()->NumberValue()); + if (info.Length() >= 3) { + mergedMiningBlockVersion = static_cast(info[2]->ToNumber()->NumberValue()); } if (!Buffer::HasInstance(block_template_buf) || !Buffer::HasInstance(nonce_buf))