Skip to content

Commit

Permalink
tendermint#121 state sync mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ackratos committed Dec 27, 2018
1 parent 53e8710 commit 30cfecf
Show file tree
Hide file tree
Showing 10 changed files with 1,022 additions and 160 deletions.
159 changes: 0 additions & 159 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions blockchain/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ func (bcR *BlockchainReactor) OnStop() {
bcR.pool.Stop()
}

// SwitchToBlockchain switches from fastest_sync mode to blockchain mode.
// It resets the state, turns off fastest_sync, and starts the blockchain state-machine
func (bcR *BlockchainReactor) SwitchToBlockchain(state sm.State, blocksSynced int) {
bcR.Logger.Info("SwitchToConsensus")
bcR.initialState = state

bcR.fastSync = true

err := bcR.pool.Start()
if err != nil {
bcR.Logger.Error("Error starting blockchainReactor", "err", err)
return
}
}

// GetChannels implements Reactor
func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor {
return []*p2p.ChannelDescriptor{
Expand Down
Loading

0 comments on commit 30cfecf

Please sign in to comment.