Update index.js
This commit is contained in:
parent
2921e389df
commit
0eaa4b6fd2
@ -231,7 +231,7 @@ BlockService.prototype._resetTip = function(callback) {
|
||||
self._header.getAllHeaders(function(err, headers) {
|
||||
|
||||
if (err || !headers) {
|
||||
return callback(err || 'headers required');
|
||||
log.error(err || 'headers required');
|
||||
}
|
||||
|
||||
log.info('Block Service: retrieved all the headers for lookups.');
|
||||
@ -276,7 +276,7 @@ BlockService.prototype._resetTip = function(callback) {
|
||||
}, function(err) {
|
||||
|
||||
if (err || !block) {
|
||||
return callback(err ||
|
||||
log.error(err ||
|
||||
'Block Service: none of the blocks from the headers match what is already indexed in the block service.');
|
||||
}
|
||||
|
||||
@ -375,7 +375,7 @@ BlockService.prototype._loadRecentBlockHashes = function(callback) {
|
||||
self.getBlock(hash, function(err, block) {
|
||||
|
||||
if (err || !block) {
|
||||
return callback(err || 'Block Service: attempted to retrieve block: ' + hash +
|
||||
log.error(err || '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 || 'Block Service: we should have a header in order to get time since last block.');
|
||||
log.error(err || '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 || 'Block Service: header not found to reorg to.');
|
||||
log.error(err || 'Block Service: header not found to reorg to.');
|
||||
}
|
||||
callback(null, header);
|
||||
});
|
||||
@ -761,7 +761,7 @@ BlockService.prototype._findBlocksToRemove = function(commonHeader, callback) {
|
||||
self._timestamp.getTimestamp(block.rhash(), function(err, timestamp) {
|
||||
|
||||
if (err || !timestamp) {
|
||||
return callback(err || 'timestamp missing from reorg.');
|
||||
log.error(err || 'timestamp missing from reorg.');
|
||||
}
|
||||
|
||||
block.__height = height;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user