From ee72d589ea9fad2de3355fd4f96e5df796989dbd Mon Sep 17 00:00:00 2001 From: jsolman Date: Mon, 18 Mar 2019 22:19:52 -0700 Subject: [PATCH] Rename flag to MoreThanFNodesCommitted. --- neo/Consensus/Helper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neo/Consensus/Helper.cs b/neo/Consensus/Helper.cs index 1a841534f9..bc2478ac48 100644 --- a/neo/Consensus/Helper.cs +++ b/neo/Consensus/Helper.cs @@ -29,14 +29,14 @@ internal static class Helper public static bool BlockSent(this IConsensusContext context) => context.Block != null; [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool ViewChanging(this IConsensusContext context) => context.ChangeViewPayloads[context.MyIndex]?.GetDeserializedMessage().NewViewNumber > context.ViewNumber && !context.FNodesCommitted(); + public static bool ViewChanging(this IConsensusContext context) => context.ChangeViewPayloads[context.MyIndex]?.GetDeserializedMessage().NewViewNumber > context.ViewNumber && !context.MoreThanFNodesCommitted(); // A possible attack can happen if the last node to commit is malicious and either sends change view after his // commit to stall nodes in a higher view, or if he refuses to send recovery messages. In addition, if a node // asking change views loses network or crashes and comes back when nodes are committed in more than one higher // numbered view, it is possible for the node accepting recovery and commit in any of the higher views, thus // potentially splitting nodes among views and stalling the network. - public static bool FNodesCommitted(this IConsensusContext context) => context.CommitPayloads.Count(p => p != null) > context.F(); + public static bool MoreThanFNodesCommitted(this IConsensusContext context) => context.CommitPayloads.Count(p => p != null) > context.F(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint GetPrimaryIndex(this IConsensusContext context, byte viewNumber)