diff --git a/lib/blockchain/chain.js b/lib/blockchain/chain.js index a86e3055..5e2cd14e 100644 --- a/lib/blockchain/chain.js +++ b/lib/blockchain/chain.js @@ -985,11 +985,12 @@ class Chain extends AsyncEmitter { // mark invalid_child from tip of fork to first block of fork while (indexWalk.height !== fork.height + 1) { indexWalk = await this.getPrevious(indexWalk) - await this.invalidate(indexWalk.hash) + await this.setInvalid(indexWalk.hash) } // check - assert.equal(await this.getPrevious(indexWalk), fork, 'nlr invalidation down to the fork') + indexWalk = await this.getPrevious(indexWalk) + assert.strictEqual(indexWalk, fork) return true }