diff --git a/lib/services/block/index.js b/lib/services/block/index.js index 73ad6be8..ba6a1aac 100644 --- a/lib/services/block/index.js +++ b/lib/services/block/index.js @@ -725,12 +725,12 @@ BlockService.prototype._findLatestValidBlockHeader = function(callback) { log.error('Block Service: we could not locate any of our recent block hashes in the header service ' + 'index. Perhaps our header service sync\'ed to the wrong chain?'); } // assert(header, 'Block Service: we could not locate any of our recent block hashes in the header service ' + 'index. Perhaps our header service sync\'ed to the wrong chain?'); - - if (header.height > self._tip.height) { - log.error('Block Service: we found a common ancestor header whose ' + 'height was greater than our current tip. This should be impossible.'); - } + if (typeof header.height !== 'undefined') { + if (header.height > self._tip.height) { + log.error('Block Service: we found a common ancestor header whose ' + 'height was greater than our current tip. This should be impossible.'); + } // assert(header.height <= self._tip.height, 'Block Service: we found a common ancestor header whose ' + 'height was greater than our current tip. This should be impossible.'); - + } callback(null, header); });