Merge PR #3706: Update InitChain to Include Time in Block Header

This commit is contained in:
Alexander Bezobchuk 2019-02-22 06:37:39 -05:00 committed by Christopher Goes
parent a814e5ce66
commit 2121160d29
2 changed files with 8 additions and 4 deletions

View File

@ -66,4 +66,7 @@
### SDK
* [\#3411] Include the `RequestInitChain.Time` in the block header init during
`InitChain`.
### Tendermint

View File

@ -318,16 +318,17 @@ func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOp
// InitChain implements the ABCI interface. It runs the initialization logic
// directly on the CommitMultiStore.
func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {
// stash the consensus params in the cms main store and memoize
if req.ConsensusParams != nil {
app.setConsensusParams(req.ConsensusParams)
app.storeConsensusParams(req.ConsensusParams)
}
// initialize the deliver state and check state with ChainID and run initChain
app.setDeliverState(abci.Header{ChainID: req.ChainId})
app.setCheckState(abci.Header{ChainID: req.ChainId})
initHeader := abci.Header{ChainID: req.ChainId, Time: req.Time}
// initialize the deliver state and check state with a correct header
app.setDeliverState(initHeader)
app.setCheckState(initHeader)
if app.initChainer == nil {
return