Skip to content

Commit 60fae93

Browse files
authored
Merge branch 'master' into cicd/more-acceptance-tests
2 parents 85a8fbb + 19bff80 commit 60fae93

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

consensus/istanbul/ibft/core/final_committed.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,23 @@
1616

1717
package core
1818

19-
import "github.com/ethereum/go-ethereum/common"
19+
import (
20+
"math/big"
21+
22+
"github.com/ethereum/go-ethereum/common"
23+
)
2024

2125
func (c *core) handleFinalCommitted() error {
2226
logger := c.logger.New("state", c.state)
2327
logger.Trace("Received a final committed proposal")
24-
go c.startNewRound(common.Big0)
28+
29+
// startNewRound() needs to be called asynchronously when the transition to qbft happens
30+
// This is required so that the stop() on core can successfully unsubscribe from events
31+
nextSeq := new(big.Int).Add(c.currentView().Sequence, big.NewInt(1))
32+
if c.backend.IsQBFTConsensusAt(nextSeq) {
33+
go c.startNewRound(common.Big0)
34+
} else {
35+
c.startNewRound(common.Big0)
36+
}
2537
return nil
2638
}

0 commit comments

Comments
 (0)