From 11534032f4192b84dfe46f01b031a4bb6323f123 Mon Sep 17 00:00:00 2001 From: ohryan Date: Thu, 16 Jul 2020 19:07:39 -0700 Subject: [PATCH] fix/update logger warning and fix incorrect assert usage --- lib/blockchain/chain.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/blockchain/chain.js b/lib/blockchain/chain.js index 3a407547..204fbb98 100644 --- a/lib/blockchain/chain.js +++ b/lib/blockchain/chain.js @@ -969,11 +969,13 @@ class Chain extends AsyncEmitter { if (tip.height - fork.height >= this.network.nlrLimit) { if (this.network.nlrLimit !== 0) { this.logger.warning( - 'NLR Activated: current=%h(%d) fork=%h(%d) reorg_size=%d', + 'NLR Activated. Preventing reorganization: current=%h(%d) competitor=%h(%d) fork=%h(%d) reorg_size=%d', tip.hash, tip.height, competitor.hash, competitor.height, + fork.hash, + fork.height, tip.height - fork.height ); @@ -988,7 +990,7 @@ class Chain extends AsyncEmitter { await this.invalidate(previous.hash) // check - assert(this.getPrevious(previous), fork) + assert.equal(this.getPrevious(previous), fork, 'nlr invalidation down to the fork') return true }