chain: minor. logging.

This commit is contained in:
Christopher Jeffrey 2017-03-04 16:00:07 -08:00
parent a96868ff8e
commit 1a5263ef23
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1274,18 +1274,17 @@ Chain.prototype._add = co(function* add(block, flags) {
if (entry.chainwork.cmp(this.tip.chainwork) <= 0) {
// Save block to an alternate chain.
yield this.saveAlternate(entry, block, prev, flags);
if (!initial)
this.emit('competitor resolved', block, entry);
} else {
// Attempt to add block to the chain index.
yield this.setBestChain(entry, block, prev, flags);
}
if (!initial) {
this.logger.debug('Orphan %s (%d) was resolved.',
block.rhash(), entry.height);
this.emit('resolved', block, entry);
}
// Emit the resolved orphan.
if (!initial) {
this.logger.debug(
'Orphan block was resolved: %s (%d).',
block.rhash(), entry.height);
this.emit('resolved', block, entry);
}
// Keep track of stats.