proto: deduplicate consensus params (#9287)

This commit is contained in:
Callum Waters
2022-08-22 10:50:21 +02:00
committed by GitHub
parent 0ca3a89c90
commit 2d8df1bd4e
29 changed files with 623 additions and 1164 deletions
+2 -3
View File
@@ -57,10 +57,9 @@ func validateBlock(state State, block *types.Block) error {
block.AppHash,
)
}
hashCP := types.HashConsensusParams(state.ConsensusParams)
if !bytes.Equal(block.ConsensusHash, hashCP) {
if !bytes.Equal(block.ConsensusHash, state.ConsensusParams.Hash()) {
return fmt.Errorf("wrong Block.Header.ConsensusHash. Expected %X, got %v",
hashCP,
state.ConsensusParams.Hash(),
block.ConsensusHash,
)
}