Skip to content

Commit 88d667b

Browse files
authored
Merge pull request #145 from getamis/feature/timeout
istanbul: update timeout formula
2 parents db82eaf + 9262ff5 commit 88d667b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

consensus/istanbul/core/core.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ func (c *core) newRoundChangeTimer() {
316316
c.stopTimer()
317317

318318
// set timeout based on the round number
319-
t := uint64(math.Pow(2, float64(c.current.Round().Uint64()))) * c.config.RequestTimeout
319+
t := c.config.RequestTimeout + uint64(math.Pow(2, float64(c.current.Round().Uint64())))
320320
timeout := time.Duration(t) * time.Millisecond
321321
c.roundChangeTimer = time.AfterFunc(timeout, func() {
322322
c.sendEvent(timeoutEvent{})

consensus/istanbul/core/handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func (c *core) Start() error {
3838
func (c *core) Stop() error {
3939
c.stopTimer()
4040
c.unsubscribeEvents()
41+
c.current = nil
4142
return nil
4243
}
4344

0 commit comments

Comments
 (0)