setInvalid instead of invalidate + strictEqual assert
instead of running this.invalidate which deadlocks the chain, set the hash to invalid manually with this.setInvalid. update assertion to use strict equal
This commit is contained in:
parent
36671d02ed
commit
83a11fbcb2
@ -985,11 +985,12 @@ class Chain extends AsyncEmitter {
|
|||||||
// mark invalid_child from tip of fork to first block of fork
|
// mark invalid_child from tip of fork to first block of fork
|
||||||
while (indexWalk.height !== fork.height + 1) {
|
while (indexWalk.height !== fork.height + 1) {
|
||||||
indexWalk = await this.getPrevious(indexWalk)
|
indexWalk = await this.getPrevious(indexWalk)
|
||||||
await this.invalidate(indexWalk.hash)
|
await this.setInvalid(indexWalk.hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check
|
// 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
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user