From 00543d4c73eecdf31f32fa18576a52976b5ff4c8 Mon Sep 17 00:00:00 2001 From: Olexandr Tarasenkov Date: Mon, 29 Jan 2018 20:33:43 +0200 Subject: [PATCH] update for Nan #2 --- src/main.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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))