From 89cbcceac4d7359a4d0b38bedd137654279a006d Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 1 Dec 2017 19:27:42 -0600 Subject: [PATCH] error if app returned negative last block height (Fixes #911) --- consensus/replay.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consensus/replay.go b/consensus/replay.go index e63e9aae0..152c9c000 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -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))