@@ -139,9 +139,11 @@ void get_block_id(const Nan::FunctionCallbackInfo<v8::Value>& info) {
139
139
blobdata input = std::string (Buffer::Data (target), Buffer::Length (target));
140
140
blobdata output = " " ;
141
141
142
+ int errorCode = 0 ;
143
+
142
144
block b = AUTO_VAL_INIT (b);
143
- if (!parse_and_validate_block_from_blob (input, b, b.major_version >= mergedMiningBlockVersion))
144
- return THROW_ERROR_EXCEPTION (" Failed to parse block" );
145
+ if (!parse_and_validate_block_from_blob (input, b, b.major_version >= mergedMiningBlockVersion, &errorCode ))
146
+ return THROW_ERROR_EXCEPTION (" Failed to parse block" + std::to_string (errorCode) );
145
147
146
148
crypto::hash block_id;
147
149
if (!get_block_hash (b, block_id, mergedMiningBlockVersion))
@@ -178,9 +180,11 @@ void construct_block_blob(const Nan::FunctionCallbackInfo<v8::Value>& info) {
178
180
blobdata block_template_blob = std::string (Buffer::Data (block_template_buf), Buffer::Length (block_template_buf));
179
181
blobdata output = " " ;
180
182
183
+ int errorCode = 0 ;
184
+
181
185
block b = AUTO_VAL_INIT (b);
182
- if (!parse_and_validate_block_from_blob (block_template_blob, b, b.major_version >= mergedMiningBlockVersion))
183
- return THROW_ERROR_EXCEPTION (" Failed to parse block" );
186
+ if (!parse_and_validate_block_from_blob (block_template_blob, b, b.major_version >= mergedMiningBlockVersion, &errorCode ))
187
+ return THROW_ERROR_EXCEPTION (" Failed to parse block" + std::to_string (errorCode) );
184
188
185
189
b.nonce = nonce;
186
190
if (b.major_version == mergedMiningBlockVersion) {
0 commit comments