set competitor chain tip to invaild
setting the competitor chain tip to invaild fixes the problem where the chain continues to sync after nlr. main chain will no longer sync with competitor after nlr
This commit is contained in:
parent
83a11fbcb2
commit
5321251db3
@ -982,10 +982,10 @@ class Chain extends AsyncEmitter {
|
||||
|
||||
let indexWalk = competitor
|
||||
|
||||
// mark invalid_child from tip of fork to first block of fork
|
||||
while (indexWalk.height !== fork.height + 1) {
|
||||
indexWalk = await this.getPrevious(indexWalk)
|
||||
// mark invalid_child from tip of competitor to first block of fork
|
||||
while (indexWalk.height > fork.height) {
|
||||
await this.setInvalid(indexWalk.hash)
|
||||
indexWalk = await this.getPrevious(indexWalk)
|
||||
}
|
||||
|
||||
// check
|
||||
|
||||
Loading…
Reference in New Issue
Block a user