File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
consensus/istanbul/ibft/core Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1616
1717package 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
2125func (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}
You can’t perform that action at this time.
0 commit comments