Merge PR #3706: Update InitChain to Include Time in Block Header
This commit is contained in:
parent
a814e5ce66
commit
2121160d29
|
@ -66,4 +66,7 @@
|
|||
|
||||
### SDK
|
||||
|
||||
* [\#3411] Include the `RequestInitChain.Time` in the block header init during
|
||||
`InitChain`.
|
||||
|
||||
### Tendermint
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue