Browse Source

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

pull/4438/head
Erik Grinaker 5 years ago
committed by GitHub
parent
commit
68f37fff65
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions
  1. +2
    -2
      blockchain/v0/reactor.go
  2. +2
    -2
      blockchain/v1/reactor.go
  3. +1
    -1
      blockchain/v1/reactor_test.go
  4. +1
    -1
      consensus/reactor.go

+ 2
- 2
blockchain/v0/reactor.go 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


+ 2
- 2
blockchain/v1/reactor.go 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


+ 1
- 1
blockchain/v1/reactor_test.go 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


+ 1
- 1
consensus/reactor.go 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


Loading…
Cancel
Save