Skip to content

Commit

Permalink
Lock change view if commit was sent
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed Oct 23, 2018
1 parent 63847fc commit 064ebc9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions neo/Consensus/ConsensusService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ private void ChangeTimer(TimeSpan delay)
private void CheckExpectedView(byte view_number)
{
if (context.ViewNumber == view_number) return;
if (context.State.HasFlag(ConsensusState.CommitSent)) return;

if (context.ExpectedView.Count(p => p == view_number) >= context.M)
{
InitializeConsensus(view_number);
Expand Down

0 comments on commit 064ebc9

Please sign in to comment.