Skip to content

Commit

Permalink
Fix a merge issue. OnConsensusPayload method should not be accepting …
Browse files Browse the repository at this point in the history
…PrepareRequest and PrepareResponse from different views.
  • Loading branch information
jsolman committed Mar 21, 2019
1 parent b7e7981 commit 9838afc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion neo/Consensus/ConsensusService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,11 @@ private void OnConsensusPayload(ConsensusPayload payload)
foreach (IP2PPlugin plugin in Plugin.P2PPlugins)
if (!plugin.OnConsensusMessage(payload))
return;
switch (payload.ConsensusMessage)
ConsensusMessage message = payload.ConsensusMessage;
if (message.ViewNumber != context.ViewNumber && (message.Type == ConsensusMessageType.PrepareRequest ||
message.Type == ConsensusMessageType.PrepareResponse))
return;
switch (message)
{
case ChangeView view:
OnChangeViewReceived(payload, view);
Expand Down

0 comments on commit 9838afc

Please sign in to comment.