[viewchange] remove unnecessary check of view id diff

Signed-off-by: Leo Chen <leo@harmony.one>
pull/3386/head
Leo Chen 4 years ago
parent 234f202656
commit e0dcb97c29
  1. 3
      consensus/view_change.go

@ -133,9 +133,6 @@ func (consensus *Consensus) getNextViewID(viewID uint64) (uint64, time.Duration)
totalNode := consensus.Decider.ParticipantsCount() totalNode := consensus.Decider.ParticipantsCount()
// diff is at least 1, and it won't exceeded the totalNode // diff is at least 1, and it won't exceeded the totalNode
diff := uint64(((curTimestamp - blockTimestamp) / viewChangeTimeout) % int64(totalNode)) diff := uint64(((curTimestamp - blockTimestamp) / viewChangeTimeout) % int64(totalNode))
if diff == 0 {
diff = 1
}
nextViewID := diff + consensus.current.GetCurBlockViewID() nextViewID := diff + consensus.current.GetCurBlockViewID()
consensus.getLogger().Info(). consensus.getLogger().Info().

Loading…
Cancel
Save