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 13, 2018
1 parent a1ad253 commit 878d9f1
Show file tree
Hide file tree
Showing 9 changed files with 1,019 additions and 159 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 878d9f1

Please sign in to comment.