From 1a5263ef232d24a73e55c819e84ab0c1907c694d Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 4 Mar 2017 16:00:07 -0800 Subject: [PATCH] chain: minor. logging. --- lib/blockchain/chain.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/blockchain/chain.js b/lib/blockchain/chain.js index 6dda4690..10892250 100644 --- a/lib/blockchain/chain.js +++ b/lib/blockchain/chain.js @@ -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.