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) { if (entry.chainwork.cmp(this.tip.chainwork) <= 0) {
// Save block to an alternate chain. // Save block to an alternate chain.
yield this.saveAlternate(entry, block, prev, flags); yield this.saveAlternate(entry, block, prev, flags);
if (!initial)
this.emit('competitor resolved', block, entry);
} else { } else {
// Attempt to add block to the chain index. // Attempt to add block to the chain index.
yield this.setBestChain(entry, block, prev, flags); yield this.setBestChain(entry, block, prev, flags);
}
if (!initial) { // Emit the resolved orphan.
this.logger.debug('Orphan %s (%d) was resolved.', if (!initial) {
block.rhash(), entry.height); this.logger.debug(
this.emit('resolved', block, entry); 'Orphan block was resolved: %s (%d).',
} block.rhash(), entry.height);
this.emit('resolved', block, entry);
} }
// Keep track of stats. // Keep track of stats.