Skip to content

Commit

Permalink
consensus/istanbul: set timeout based on round
Browse files Browse the repository at this point in the history
  • Loading branch information
markya0616 committed Jun 22, 2017
1 parent 999fd30 commit e76a5b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion consensus/istanbul/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ func (c *core) newRoundChangeTimer() {
c.roundChangeTimer.Stop()
}

timeout := time.Duration(c.config.RequestTimeout) * time.Millisecond
// set timeout based on the round number
timeout := time.Duration(c.config.RequestTimeout)*time.Millisecond + time.Duration(c.current.Round().Uint64()*c.config.BlockPeriod)*time.Second
c.roundChangeTimer = time.AfterFunc(timeout, func() {
// If we're not waiting for round change yet, we can try to catch up
// the max round with F+1 round change message. We only need to catch up
Expand Down

0 comments on commit e76a5b5

Please sign in to comment.