/// <summary>
 /// The blockchain start timestamp is incorrect during the first round,
 /// don't worry, we can return NextRound without hesitation.
 /// Besides, return only NextRound for single node running.
 /// </summary>
 /// <returns></returns>
 protected override AElfConsensusBehaviour GetConsensusBehaviourToTerminateCurrentRound() =>
 CurrentRound.RoundNumber == 1 ||     // Return NEXT_ROUND in first round.
 !CurrentRound.NeedToChangeTerm(_blockchainStartTimestamp,
                                CurrentRound.TermNumber, _periodSeconds) ||
 CurrentRound.RealTimeMinersInformation.Keys.Count == 1     // Return NEXT_ROUND for single node.
         ? AElfConsensusBehaviour.NextRound
         : AElfConsensusBehaviour.NextTerm;
Ejemplo n.º 2
0
 /// <summary>
 /// The blockchain start timestamp is incorrect during the first round,
 /// don't worry, we can return NextRound without hesitation.
 /// Besides, return only NextRound for single node running.
 /// </summary>
 /// <returns></returns>
 protected override AElfConsensusBehaviour GetConsensusBehaviourToTerminateCurrentRound() =>
 CurrentRound.RoundNumber == 1 || !CurrentRound.NeedToChangeTerm(_blockchainStartTimestamp,
                                                                 CurrentRound.TermNumber, _timeEachTerm) || CurrentRound.RealTimeMinersInformation.Keys.Count == 1
         ? AElfConsensusBehaviour.NextRound
         : AElfConsensusBehaviour.NextTerm;
Ejemplo n.º 3
0
 /// <summary>
 /// In the first round, the blockchain start timestamp is incorrect,
 /// thus we can return NextRound directly.
 /// </summary>
 /// <returns></returns>
 protected override AElfConsensusBehaviour GetConsensusBehaviourToTerminateCurrentRound() =>
 CurrentRound.RoundNumber == 1 || !CurrentRound.NeedToChangeTerm(_blockchainStartTimestamp,
                                                                 CurrentRound.TermNumber, _timeEachTerm)
         ? AElfConsensusBehaviour.NextRound
         : AElfConsensusBehaviour.NextTerm;