Added test to check header.height

This commit is contained in:
tripathyr 2021-05-25 11:01:31 +05:30 committed by GitHub
parent 0cfb80a164
commit 2c37e05ff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
});