Merge PR #3304: Non-zero-height export fix

* Tiny non-zero-height export fix
* Fix linter
This commit is contained in:
Christopher Goes 2019-01-16 15:59:19 +01:00 committed by GitHub
parent 133934ae37
commit eff1f7ca10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -65,12 +65,14 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) abci.Application
func exportAppStateAndTMValidators(
logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool,
) (json.RawMessage, []tmtypes.GenesisValidator, error) {
gApp := app.NewGaiaApp(logger, db, traceStore, false)
if height != -1 {
gApp := app.NewGaiaApp(logger, db, traceStore, false)
err := gApp.LoadHeight(height)
if err != nil {
return nil, nil, err
}
return gApp.ExportAppStateAndValidators(forZeroHeight)
}
gApp := app.NewGaiaApp(logger, db, traceStore, true)
return gApp.ExportAppStateAndValidators(forZeroHeight)
}