add missing awaits
This commit is contained in:
parent
7a1816a3a8
commit
9f9c536efc
@ -856,7 +856,7 @@ class Chain extends AsyncEmitter {
|
|||||||
assert(fork, 'No free space or data corruption.');
|
assert(fork, 'No free space or data corruption.');
|
||||||
|
|
||||||
// Check NLR
|
// Check NLR
|
||||||
if (this.noLongReorg(tip, fork, competitor)) return true
|
if (await this.noLongReorg(tip, fork, competitor)) return true
|
||||||
|
|
||||||
// Blocks to disconnect.
|
// Blocks to disconnect.
|
||||||
const disconnect = [];
|
const disconnect = [];
|
||||||
@ -916,7 +916,7 @@ class Chain extends AsyncEmitter {
|
|||||||
assert(fork, 'No free space or data corruption.');
|
assert(fork, 'No free space or data corruption.');
|
||||||
|
|
||||||
// Check NLR
|
// Check NLR
|
||||||
if (this.noLongReorg(tip, fork, competitor)) return true
|
if (await this.noLongReorg(tip, fork, competitor)) return true
|
||||||
|
|
||||||
// Buffer disconnected blocks.
|
// Buffer disconnected blocks.
|
||||||
const disconnect = [];
|
const disconnect = [];
|
||||||
@ -980,12 +980,12 @@ class Chain extends AsyncEmitter {
|
|||||||
// mark invalid_child from tip of fork to second block of fork
|
// mark invalid_child from tip of fork to second block of fork
|
||||||
while (competitor.height > fork.height + 2) {
|
while (competitor.height > fork.height + 2) {
|
||||||
const previous = await this.getPrevious(competitor)
|
const previous = await this.getPrevious(competitor)
|
||||||
this.invalidate(previous.hash)
|
await this.invalidate(previous.hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark invalid first block of fork
|
// mark invalid first block of fork
|
||||||
const previous = await this.getPrevious(competitor)
|
const previous = await this.getPrevious(competitor)
|
||||||
this.invalidate(previous.hash)
|
await this.invalidate(previous.hash)
|
||||||
|
|
||||||
// check
|
// check
|
||||||
assert(this.getPrevious(previous), fork)
|
assert(this.getPrevious(previous), fork)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user