Skip to content

Commit

Permalink
refactor(core-blockchain): reset missedBlocks before await call (#3598)
Browse files Browse the repository at this point in the history
  • Loading branch information
air1one authored Mar 13, 2020
1 parent 37c37ed commit 4831c7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core-blockchain/src/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,13 +575,13 @@ export class Blockchain implements blockchain.IBlockchain {
this.missedBlocks >= Managers.configManager.getMilestone().activeDelegates / 3 - 1 &&
Math.random() <= 0.8
) {
this.missedBlocks = 0;

const networkStatus = await this.p2p.getMonitor().checkNetworkHealth();
if (networkStatus.forked) {
this.state.numberOfBlocksToRollback = networkStatus.blocksToRollback;
this.dispatch("FORK");
}

this.missedBlocks = 0;
}
}
}

0 comments on commit 4831c7a

Please sign in to comment.