diff --git a/.gitignore b/.gitignore index 6d32fe91..6709219a 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ regtest/data/node3/regtest bitcore-node.json* *.bak *.orig +lib/services/insight-api diff --git a/lib/services/header/index.js b/lib/services/header/index.js index 2a81f8f4..385f377a 100644 --- a/lib/services/header/index.js +++ b/lib/services/header/index.js @@ -402,7 +402,7 @@ HeaderService.prototype._onHeadersSave = function(err) { }); } - log.info('Header Service: emitting headers to block service.'); + log.debug('Header Service: emitting headers to block service.'); self.emit('headers'); }); diff --git a/lib/services/insight-api b/lib/services/insight-api deleted file mode 120000 index 86f819d4..00000000 --- a/lib/services/insight-api +++ /dev/null @@ -1 +0,0 @@ -/Users/chrisk/source/insight-api \ No newline at end of file diff --git a/test/regtest/reorg.js b/test/regtest/reorg.js index 9b25ee62..179fa865 100644 --- a/test/regtest/reorg.js +++ b/test/regtest/reorg.js @@ -207,7 +207,7 @@ describe('Reorg', function() { shutdownBitcore(done); }); - it('should reorg correctly', function(done) { + it('should reorg correctly when already synced', function(done) { // at this point we have a fully synced chain at height 7.... // we now want to send a new block number 7 whose prev hash is block 6 (it should be block 7) @@ -216,13 +216,15 @@ describe('Reorg', function() { setTimeout(function() { console.log('From Test: reorging to block: ' + reorgBlock.rhash()); + + // send the reorg block rawBlocks.push(rawReorgBlocks); var blockHash = reorgBlock.rhash(); var inv = p2p.Inventory.forBlock(blockHash); - var msg = messages.Inventory([inv]); tcpSocket.write(msg.toBuffer()); + // wait 2 secs until the reorg happens, if it takes any longer the test ought to fail anyway setTimeout(function() { var error; var request = http.request('http://localhost:53001/api/block/' + reorgBlock.rhash(), function(res) { @@ -269,5 +271,6 @@ describe('Reorg', function() { }); + });