From 726156843ecc18a79132a989addc7f4ed8f6f5fe Mon Sep 17 00:00:00 2001 From: tripathyr Date: Mon, 24 Jan 2022 17:45:10 +0530 Subject: [PATCH] Update index.js --- lib/services/block/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/services/block/index.js b/lib/services/block/index.js index 36324e4a..ee83f88d 100644 --- a/lib/services/block/index.js +++ b/lib/services/block/index.js @@ -231,7 +231,7 @@ BlockService.prototype._resetTip = function(callback) { self._header.getAllHeaders(function(err, headers) { if (err || !headers) { - return callback(err || log.info('headers required')); + return callback(err || log.warn('headers required')); } log.info('Block Service: retrieved all the headers for lookups.'); @@ -277,7 +277,7 @@ BlockService.prototype._resetTip = function(callback) { if (err || !block) { return callback(err || - log.info('Block Service: none of the blocks from the headers match what is already indexed in the block service.')); + log.error('Block Service: none of the blocks from the headers match what is already indexed in the block service.')); } self._setTip({ hash: block.rhash(), height: height + 1 }, callback); @@ -375,7 +375,7 @@ BlockService.prototype._loadRecentBlockHashes = function(callback) { self.getBlock(hash, function(err, block) { if (err || !block) { - return callback(err || log.info('Block Service: attempted to retrieve block: ' + hash + + return callback(err || log.error('Block Service: attempted to retrieve block: ' + hash + ' but was not in the index.')); } @@ -415,7 +415,7 @@ BlockService.prototype._getTimeSinceLastBlock = function(callback) { self._header.getBlockHeader(Math.max(self._tip.height - 1, 0), function(err, header) { if(err || !header) { - return callback(err || log.info('Block Service: we should have a header in order to get time since last block.')); + return callback(err || log.error('Block Service: we should have a header in order to get time since last block.')); } async.map([ self._tip.hash, header.hash ], function(hash, next) { @@ -665,7 +665,7 @@ BlockService.prototype._findLatestValidBlockHeader = function(callback) { if (self._reorgToBlock) { return self._header.getBlockHeader(self._reorgToBlock, function(err, header) { if (err || !header) { - return callback(err || log.info('Block Service: header not found to reorg to.')); + return callback(err || log.error('Block Service: header not found to reorg to.')); } callback(null, header); }); @@ -755,13 +755,13 @@ BlockService.prototype._findBlocksToRemove = function(commonHeader, callback) { self._getBlock(hash, function(err, block) { if (err || !block) { - return next(err || log.info('Block Service: block not found in index.')); + return next(err || log.error('Block Service: block not found in index.')); } self._timestamp.getTimestamp(block.rhash(), function(err, timestamp) { if (err || !timestamp) { - return callback(err || log.info('timestamp missing from reorg.')); + return callback(err || log.error('timestamp missing from reorg.')); } block.__height = height;