chain: improve version display. fix getLocator.

This commit is contained in:
Christopher Jeffrey 2017-07-20 17:22:59 -07:00
parent 6a7c5eac8d
commit ffec8ff2d7
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -923,7 +923,7 @@ Chain.prototype.setBestChain = async function setBestChain(entry, block, prev, f
if (entry.hasUnknown()) { if (entry.hasUnknown()) {
this.logger.warning( this.logger.warning(
'Unknown version bits in block %d: %d.', 'Unknown version bits in block %d: %d.',
entry.height, entry.version); entry.height, util.hex32(entry.version));
} }
// Otherwise, everything is in order. // Otherwise, everything is in order.
@ -1838,8 +1838,10 @@ Chain.prototype._getLocator = async function getLocator(start) {
entry = await this.db.getEntry(start); entry = await this.db.getEntry(start);
if (!entry) if (!entry) {
throw new Error('Tip not found.'); entry = this.tip;
hashes.push(start);
}
hash = entry.hash; hash = entry.hash;
height = entry.height; height = entry.height;