From aaa26a65e4c858255665717110567c0367723fe2 Mon Sep 17 00:00:00 2001 From: HaoyangLiu Date: Tue, 13 Nov 2018 20:09:52 +0800 Subject: [PATCH] Use RetreatLastBlock if blockHeight=stateHeight+1 --- Gopkg.lock | 6 +++--- Gopkg.toml | 2 +- app/app.go | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 33d3fd6aa..780d20666 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -654,7 +654,7 @@ version = "v0.9.2-iris1" [[projects]] - digest = "1:e787411e638d991be9b98018f4f31854fb33e28d8e3e4a5b1e6fbeed39f51bb4" + digest = "1:ce7b868fd7716430c2fb558fdad770afc99ab9b8b56ef328c4905efdbe73e894" name = "github.com/tendermint/tendermint" packages = [ "abci/client", @@ -717,9 +717,9 @@ "version", ] pruneopts = "UT" - revision = "46b52ca74937f3a680a4861f7b60b262d3fda777" + revision = "346fca927125f6db611c783faa71b7a9f6469b7c" source = "https://github.com/irisnet/tendermint.git" - version = "0.23.1-rc0-iris1" + version = "0.23.1-rc0-iris2" [[projects]] digest = "1:bf6d9a827ea3cad964c2f863302e4f6823170d0b5ed16f72cf1184a7c615067e" diff --git a/Gopkg.toml b/Gopkg.toml index a32251290..ba41edeea 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -55,7 +55,7 @@ [[override]] name = "github.com/tendermint/tendermint" source = "https://github.com/irisnet/tendermint.git" - version = "=v0.23.1-rc0-iris1" + version = "=v0.23.1-rc0-iris2" [[constraint]] name = "github.com/rakyll/statik" diff --git a/app/app.go b/app/app.go index 5a9a150c8..8cf38fe8c 100644 --- a/app/app.go +++ b/app/app.go @@ -372,7 +372,9 @@ func (app *IrisApp) replay() int64 { sm.SaveState(stateDB, preState) loadHeight = preState.LastBlockHeight } else if blockStore.Height() == curState.LastBlockHeight+1 { - loadHeight = curState.LastBlockHeight + blockStore.RetreatLastBlock() + sm.SaveState(stateDB, preState) + loadHeight = preState.LastBlockHeight } else { panic(errors.New("tendermint block store height should be at most one ahead of the its state height")) }