Fix comments about AppHash, rollbacks, etc

This commit is contained in:
Jae Kwon 2016-01-09 12:09:31 -08:00
parent 3e3c0083c7
commit 5d06bb964b
2 changed files with 3 additions and 3 deletions

View File

@ -807,7 +807,7 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts
LastBlockHash: cs.state.LastBlockHash,
LastBlockParts: cs.state.LastBlockParts,
ValidatorsHash: cs.state.Validators.Hash(),
AppHash: cs.state.AppHash,
AppHash: cs.state.AppHash, // state merkle root of txs from the previous block.
},
LastValidation: validation,
Data: &types.Data{
@ -1134,6 +1134,7 @@ func (cs *ConsensusState) finalizeCommit(height int) {
log.Info(Fmt("%v", block))
// Fire off event for new block.
// TODO: Handle app failure. See #177
cs.evsw.FireEvent(types.EventStringNewBlock(), types.EventDataNewBlock{block})
// Create a copy of the state for staging
@ -1141,7 +1142,6 @@ func (cs *ConsensusState) finalizeCommit(height int) {
// Run the block on the State:
// + update validator sets
// + first rolls back proxyAppConn
// + run txs on the proxyAppConn
err := stateCopy.ExecBlock(cs.evsw, cs.proxyAppConn, block, blockParts.Header())
if err != nil {

View File

@ -140,7 +140,7 @@ type Header struct {
LastValidationHash []byte `json:"last_validation_hash"`
DataHash []byte `json:"data_hash"`
ValidatorsHash []byte `json:"validators_hash"`
AppHash []byte `json:"app_hash"`
AppHash []byte `json:"app_hash"` // state merkle root of txs from the previous block
}
// NOTE: hash is nil if required fields are missing.