Merge branch 'master' into callum/4728-check-evidence

This commit is contained in:
Callum Waters
2020-04-29 14:04:04 +02:00
committed by GitHub
54 changed files with 10344 additions and 626 deletions
+10
View File
@@ -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