Skip to content

Commit

Permalink
Merge PR cosmos#3706: Update InitChain to Include Time in Block Header
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez authored and cwgoes committed Feb 22, 2019
1 parent a814e5c commit 2121160
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@

### SDK

* [\#3411] Include the `RequestInitChain.Time` in the block header init during
`InitChain`.

### Tendermint
9 changes: 5 additions & 4 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2121160

Please sign in to comment.