Skip to content

Commit 3730ecf

Browse files
markya0616tailingchen
authored andcommitted
consensus/istanbul: set timeout based on round
1 parent f2f493b commit 3730ecf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

consensus/istanbul/core/core.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ func (c *core) newRoundChangeTimer() {
246246
c.roundChangeTimer.Stop()
247247
}
248248

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

0 commit comments

Comments
 (0)