mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-21 14:46:15 +00:00
Merge branch 'master' into callum/4728-check-evidence
This commit is contained in:
@@ -117,6 +117,16 @@ func saveState(db dbm.DB, state State, key []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
// BootstrapState saves a new state, used e.g. by state sync when starting from non-zero height.
|
||||
func BootstrapState(db dbm.DB, state State) error {
|
||||
height := state.LastBlockHeight
|
||||
saveValidatorsInfo(db, height, height, state.LastValidators)
|
||||
saveValidatorsInfo(db, height+1, height+1, state.Validators)
|
||||
saveValidatorsInfo(db, height+2, height+2, state.NextValidators)
|
||||
saveConsensusParamsInfo(db, height+1, height+1, state.ConsensusParams)
|
||||
return db.SetSync(stateKey, state.Bytes())
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// ABCIResponses retains the responses
|
||||
|
||||
Reference in New Issue
Block a user