use copybuffer

bcn
clintar 2015-11-12 13:42:40 -07:00 committed by Harald Wolff
parent 25db84cdf0
commit 7551044f8a
1 changed files with 2 additions and 1 deletions

View File

@ -143,8 +143,9 @@ void get_block_id(const Nan::FunctionCallbackInfo<v8::Value>& info) {
return THROW_ERROR_EXCEPTION("Failed to calculate hash for block");
char *cstr = reinterpret_cast<char*>(&block_id);
v8::Local<v8::Value> returnValue = Nan::CopyBuffer(cstr, 32).ToLocalChecked();
info.GetReturnValue().Set(
Nan::NewBuffer(cstr, 32, callback,0).ToLocalChecked()
returnValue
);
}