state: ABCIResponses, s.Save() in ApplyBlock

This commit is contained in:
Ethan Buchman
2017-04-14 15:33:19 -04:00
parent 9d2de2b756
commit cb279bf662
4 changed files with 127 additions and 54 deletions

View File

@@ -1221,7 +1221,7 @@ func (cs *ConsensusState) finalizeCommit(height int) {
stateCopy := cs.state.Copy()
eventCache := types.NewEventCache(cs.evsw)
// Execute and commit the block, and update the mempool.
// Execute and commit the block, update and save the state, and update the mempool.
// All calls to the proxyAppConn should come here.
// NOTE: the block.AppHash wont reflect these txs until the next block
err := stateCopy.ApplyBlock(eventCache, cs.proxyAppConn, block, blockParts.Header(), cs.mempool)
@@ -1233,14 +1233,10 @@ func (cs *ConsensusState) finalizeCommit(height int) {
fail.Fail() // XXX
// Fire off event for new block.
// TODO: Handle app failure. See #177
types.FireEventNewBlock(cs.evsw, types.EventDataNewBlock{block})
types.FireEventNewBlockHeader(cs.evsw, types.EventDataNewBlockHeader{block.Header})
eventCache.Flush()
// Save the state.
stateCopy.Save()
fail.Fail() // XXX
// NewHeightStep!