Add ConsensusHash to header

This commit is contained in:
Ethan Frey
2017-12-19 12:28:08 -05:00
committed by Ethan Buchman
parent 56cada6a0c
commit d151e36ea8
7 changed files with 33 additions and 14 deletions
+1 -1
View File
@@ -187,7 +187,7 @@ func (s *State) ValidateBlock(block *types.Block) error {
func (s *State) validateBlock(block *types.Block) error {
// Basic block validation.
err := block.ValidateBasic(s.ChainID, s.LastBlockHeight,
s.LastBlockTotalTx, s.LastBlockID, s.LastBlockTime, s.AppHash)
s.LastBlockTotalTx, s.LastBlockID, s.LastBlockTime, s.AppHash, s.Params.Hash())
if err != nil {
return err
}
+1 -1
View File
@@ -120,7 +120,7 @@ func makeBlock(height int64, state *State) *types.Block {
block, _ := types.MakeBlock(height, chainID,
makeTxs(height), state.LastBlockTotalTx,
new(types.Commit), prevBlockID, valHash,
state.AppHash, testPartSize)
state.AppHash, state.Params.Hash(), testPartSize)
return block
}
+3 -2
View File
@@ -269,8 +269,9 @@ func (s *State) SetBlockAndValidators(header *types.Header, blockPartsHeader typ
}
// applyChanges returns a new param set, overriding any
// parameter that is non-zero in argument
// applyChanges returns new ConsensusParams
// whose fields are set to any non-zero fields of c.
// If c is nil, it returns p unmodified, as it was passed in.
func applyChanges(p types.ConsensusParams,
c *abci.ConsensusParams) types.ConsensusParams {