Browse Source

Fix comments about AppHash, rollbacks, etc

pull/176/head
Jae Kwon 9 years ago
parent
commit
5d06bb964b
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      consensus/state.go
  2. +1
    -1
      types/block.go

+ 2
- 2
consensus/state.go 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 {


+ 1
- 1
types/block.go 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.


Loading…
Cancel
Save