From edc5e272dbacff29493b98860ff470c29f53f09a Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 17 Feb 2017 10:57:09 -0500 Subject: [PATCH] consensus: nice error msg if ApplyBlock fails --- consensus/state.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/consensus/state.go b/consensus/state.go index 231d74bb3..30ca8e9fa 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1232,7 +1232,8 @@ func (cs *ConsensusState) finalizeCommit(height int) { seenCommit := precommits.MakeCommit() cs.blockStore.SaveBlock(block, blockParts, seenCommit) } else { - log.Warn("Why are we finalizeCommitting a block height we already have?", "height", block.Height) + // Happens during replay if we already saved the block but didn't commit + log.Notice("Calling finalizeCommit on already stored block", "height", block.Height) } fail.Fail() // XXX @@ -1247,7 +1248,8 @@ func (cs *ConsensusState) finalizeCommit(height int) { // NOTE: the block.AppHash wont reflect these txs until the next block err := stateCopy.ApplyBlock(eventCache, cs.proxyAppConn, block, blockParts.Header(), cs.mempool) if err != nil { - // TODO! + log.Warn("Error on ApplyBlock. Did the application crash? Please restart tendermint", "error", err) + return } fail.Fail() // XXX