From 2121160d29016751c3240c9954c92a987d2e6f86 Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Fri, 22 Feb 2019 06:37:39 -0500 Subject: [PATCH] Merge PR #3706: Update InitChain to Include Time in Block Header --- PENDING.md | 3 +++ baseapp/baseapp.go | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/PENDING.md b/PENDING.md index 86b89e082e..92e126bdc0 100644 --- a/PENDING.md +++ b/PENDING.md @@ -66,4 +66,7 @@ ### SDK +* [\#3411] Include the `RequestInitChain.Time` in the block header init during +`InitChain`. + ### Tendermint diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 3b61342c8b..76a7c25c1d 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -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