improve logging, via time

This commit is contained in:
Manuel Araoz 2015-04-13 17:53:17 -03:00
parent 6691f0b4b5
commit 80279a0c6e

View File

@ -50,6 +50,17 @@ var BitcoreNode = function(bus, networkMonitor, blockService, transactionService
});
});
*/
setInterval(function() {
if (!self.blockchain) {
// not ready yet
return;
}
var tipHash = self.blockchain.tip;
var block = self.blockCache[tipHash];
console.log('block', block.id, 'height', block.height);
}, 5 * 1000);
this.bus.register(bitcore.Block, function(block) {
var prevHash = bitcore.util.buffer.reverse(block.header.prevHash).toString('hex');
@ -65,10 +76,6 @@ var BitcoreNode = function(bus, networkMonitor, blockService, transactionService
block.height = self.blockchain.height[block.id];
block.work = self.blockchain.work[block.id];
if (block.height % 100 === 0) {
console.log('block', block.id, 'height', block.height);
}
return Promise.each(blockchainChanges.unconfirmed, function(hash) {
return self.blockService.unconfirm(self.blockCache[hash]);
})