diff --git a/integration/index.js b/integration/index.js index 2eb4160b..04849e6c 100644 --- a/integration/index.js +++ b/integration/index.js @@ -51,7 +51,7 @@ describe('Basic Functionality', function() { var block = bitcore.Block.fromString(data); it('block ' + block.hash, function(done) { bitcoind.getBlock(block.hash, function(err, response) { - assert(response === data, 'incorrect block data for ' + block.hash); + assert(response.toString('hex') === data, 'incorrect block data for ' + block.hash); done(); }); }); diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index 8b11078d..0c0c6bc5 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -869,7 +869,7 @@ async_get_block(uv_work_t *req) { fread(&size, sizeof(uint32_t), 1, blockFile); // Read block - char buffer[size]; + char* buffer = (char *)malloc(sizeof(char) * size); fread((void *)buffer, sizeof(char), size, blockFile); fclose(blockFile);