error if app returned negative last block height (Fixes #911)

This commit is contained in:
Anton Kaliaev
2017-12-01 19:27:42 -06:00
parent 10f7858453
commit 89cbcceac4

View File

@@ -207,6 +207,9 @@ func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error {
}
blockHeight := int64(res.LastBlockHeight)
if blockHeight < 0 {
return fmt.Errorf("Got a negative last block height (%d) from the app", blockHeight)
}
appHash := res.LastBlockAppHash
h.logger.Info("ABCI Handshake", "appHeight", blockHeight, "appHash", fmt.Sprintf("%X", appHash))