mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-24 02:01:43 +00:00
Add ResultHash to header
This commit is contained in:
committed by
Ethan Buchman
parent
632cc918b4
commit
58c5df729b
@ -241,6 +241,7 @@ func (s *State) MakeBlock(height int64, txs []types.Tx, commit *types.Commit) (*
|
||||
block.ValidatorsHash = s.Validators.Hash()
|
||||
block.AppHash = s.AppHash
|
||||
block.ConsensusHash = s.LastConsensusParams.Hash()
|
||||
block.ResultsHash = s.LastResultHash
|
||||
|
||||
return block, block.MakePartSet(s.ConsensusParams.BlockGossip.BlockPartSizeBytes)
|
||||
}
|
||||
@ -279,6 +280,9 @@ func (s *State) validateBlock(b *types.Block) error {
|
||||
if !bytes.Equal(b.ConsensusHash, s.LastConsensusParams.Hash()) {
|
||||
return fmt.Errorf("Wrong Block.Header.ConsensusHash. Expected %X, got %v", s.LastConsensusParams.Hash(), b.ConsensusHash)
|
||||
}
|
||||
if !bytes.Equal(b.ResultsHash, s.LastResultHash) {
|
||||
return fmt.Errorf("Wrong Block.Header.ResultsHash. Expected %X, got %v", s.LastResultHash, b.ResultsHash)
|
||||
}
|
||||
|
||||
// Validate block LastCommit.
|
||||
if b.Height == 1 {
|
||||
|
Reference in New Issue
Block a user