|
|
@ -131,9 +131,8 @@ func (consensus *Consensus) getNextViewID() (uint64, time.Duration) { |
|
|
|
if curTimestamp <= blockTimestamp { |
|
|
|
if curTimestamp <= blockTimestamp { |
|
|
|
return consensus.fallbackNextViewID() |
|
|
|
return consensus.fallbackNextViewID() |
|
|
|
} |
|
|
|
} |
|
|
|
totalNode := consensus.Decider.ParticipantsCount() |
|
|
|
|
|
|
|
// diff is at least 1, and it won't exceed the totalNode
|
|
|
|
// diff is at least 1, and it won't exceed the totalNode
|
|
|
|
diff := uint64(((curTimestamp - blockTimestamp) / viewChangeTimeout) % int64(totalNode)) |
|
|
|
diff := uint64((curTimestamp - blockTimestamp) / viewChangeTimeout) |
|
|
|
nextViewID := diff + consensus.GetCurBlockViewID() |
|
|
|
nextViewID := diff + consensus.GetCurBlockViewID() |
|
|
|
|
|
|
|
|
|
|
|
consensus.getLogger().Info(). |
|
|
|
consensus.getLogger().Info(). |
|
|
|