Use uint64 for consensus.Reactor.SwitchToConsensus() blocksSynced (#4433)

This commit is contained in:
Erik Grinaker
2020-02-19 12:28:34 +01:00
committed by GitHub
parent 6c67e246c3
commit 68f37fff65
4 changed files with 6 additions and 6 deletions

View File

@@ -41,7 +41,7 @@ const (
type consensusReactor interface {
// for when we switch from blockchain reactor and fast sync to
// the consensus machine
SwitchToConsensus(sm.State, int)
SwitchToConsensus(sm.State, uint64)
}
type peerError struct {
@@ -214,7 +214,7 @@ func (bcR *BlockchainReactor) poolRoutine() {
statusUpdateTicker := time.NewTicker(statusUpdateIntervalSeconds * time.Second)
switchToConsensusTicker := time.NewTicker(switchToConsensusIntervalSeconds * time.Second)
blocksSynced := 0
blocksSynced := uint64(0)
chainID := bcR.initialState.ChainID
state := bcR.initialState

View File

@@ -43,7 +43,7 @@ var (
type consensusReactor interface {
// for when we switch from blockchain reactor and fast sync to
// the consensus machine
SwitchToConsensus(sm.State, int)
SwitchToConsensus(sm.State, uint64)
}
// BlockchainReactor handles long-term catchup syncing.
@@ -59,7 +59,7 @@ type BlockchainReactor struct {
fastSync bool
fsm *BcReactorFSM
blocksSynced int
blocksSynced uint64
// Receive goroutine forwards messages to this channel to be processed in the context of the poolRoutine.
messagesForFSMCh chan bcReactorMessage

View File

@@ -157,7 +157,7 @@ type consensusReactorTest struct {
mtx sync.Mutex
}
func (conR *consensusReactorTest) SwitchToConsensus(state sm.State, blocksSynced int) {
func (conR *consensusReactorTest) SwitchToConsensus(state sm.State, blocksSynced uint64) {
conR.mtx.Lock()
defer conR.mtx.Unlock()
conR.switchedToConsensus = true

View File

@@ -98,7 +98,7 @@ func (conR *Reactor) OnStop() {
// SwitchToConsensus switches from fast_sync mode to consensus mode.
// It resets the state, turns off fast_sync, and starts the consensus state-machine
func (conR *Reactor) SwitchToConsensus(state sm.State, blocksSynced int) {
func (conR *Reactor) SwitchToConsensus(state sm.State, blocksSynced uint64) {
conR.Logger.Info("SwitchToConsensus")
conR.conS.reconstructLastCommit(state)
// NOTE: The line below causes broadcastNewRoundStepRoutine() to