diff --git a/integration/index.js b/integration/index.js index f7cbe53c..10758fa5 100644 --- a/integration/index.js +++ b/integration/index.js @@ -78,4 +78,22 @@ describe('Basic Functionality', function() { }); }); + describe.skip('get the chain', function() { + + var heights = []; + for (var i = 364599; i >= 0 ; i--) { + heights.push(i); + } + + heights.forEach(function(height) { + it('block at height ' + height, function(done) { + bitcoind.getBlock(height, function(err, response) { + var block = bitcore.Block.fromBuffer(response); + console.log(block.hash); + done(); + }); + }); + }); + }); + }); diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index a62f3d06..28599bad 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -906,6 +906,9 @@ async_get_block_after(uv_work_t *req) { Local rawNodeBuffer = node::Buffer::New(isolate, data->buffer, data->size); + delete data->buffer; + data->buffer = NULL; + const unsigned argc = 2; Local argv[argc] = { Local::New(isolate, NanNull()),