diff --git a/baseapp/abci.go b/baseapp/abci.go index eb5971a5bf53..50f5032aa5cc 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -125,8 +125,8 @@ func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOp // Info implements the ABCI interface. func (app *BaseApp) Info(req abci.RequestInfo) abci.ResponseInfo { lastCommitID := app.cms.LastCommitID() - // load the app version for a non zero height - if lastCommitID.Version > 0 { + // load the app version for a non zero height and zero app hash + if lastCommitID.Version > 0 && app.appVersion == 0 { ctx, err := app.createQueryContext(lastCommitID.Version, false) if err != nil { panic(err) diff --git a/baseapp/options.go b/baseapp/options.go index b3d4c20fb6cf..ba29aa977f36 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -112,14 +112,14 @@ func (app *BaseApp) SetVersion(v string) { } // SetAppVersion sets the application's protocol version -func (app *BaseApp) SetAppVersion(ctx sdk.Context, v uint64) { +func (app *BaseApp) SetAppVersion(ctx sdk.Context, version uint64) { // TODO: could make this less hacky in the future since the SDK // shouldn't have to know about the app versioning scheme - if ctx.BlockHeader().Version.App >= 2 { - vp := &tmproto.VersionParams{AppVersion: v} + if version >= 2 { + vp := &tmproto.VersionParams{AppVersion: version} app.paramStore.Set(ctx, ParamStoreKeyVersionParams, vp) } - app.appVersion = v + app.appVersion = version } func (app *BaseApp) SetDB(db dbm.DB) {