Skip to content

Commit

Permalink
Merge pull request tendermint#18 from BiJie/nostate
Browse files Browse the repository at this point in the history
[R4R]validator do not verify hash when with no state
  • Loading branch information
zjubfd committed Dec 17, 2018
2 parents 93d3b62 + ddeee6c commit 3f17d89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions state/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block, withAppStat
block.LastResultsHash,
)
}
if !bytes.Equal(block.ValidatorsHash, state.Validators.Hash()) {
if withAppStat && !bytes.Equal(block.ValidatorsHash, state.Validators.Hash()) {
return fmt.Errorf(
"Wrong Block.Header.ValidatorsHash. Expected %X, got %v",
state.Validators.Hash(),
block.ValidatorsHash,
)
}
if !bytes.Equal(block.NextValidatorsHash, state.NextValidators.Hash()) {
if withAppStat && !bytes.Equal(block.NextValidatorsHash, state.NextValidators.Hash()) {
return fmt.Errorf("Wrong Block.Header.NextValidatorsHash. Expected %X, got %v", state.NextValidators.Hash(), block.NextValidatorsHash)
}

Expand Down

0 comments on commit 3f17d89

Please sign in to comment.