call it LastResultsHash

This commit is contained in:
Ethan Buchman
2017-12-26 19:53:26 -05:00
parent 801e3dfacf
commit 028ee58580
7 changed files with 23 additions and 32 deletions

View File

@ -243,7 +243,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
block.LastResultsHash = s.LastResultsHash
return block, block.MakePartSet(s.ConsensusParams.BlockGossip.BlockPartSizeBytes)
}
@ -282,8 +282,8 @@ 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)
if !bytes.Equal(b.LastResultsHash, s.LastResultsHash) {
return fmt.Errorf("Wrong Block.Header.LastResultsHash. Expected %X, got %v", s.LastResultsHash, b.LastResultsHash)
}
// Validate block LastCommit.