diff --git a/domain/consensus/processes/blockvalidator/block_header_in_isolation.go b/domain/consensus/processes/blockvalidator/block_header_in_isolation.go index 6266ab1bc1..26e1399f4d 100644 --- a/domain/consensus/processes/blockvalidator/block_header_in_isolation.go +++ b/domain/consensus/processes/blockvalidator/block_header_in_isolation.go @@ -65,14 +65,12 @@ func (v *blockValidator) checkBlockVersion(header externalapi.BlockHeader) error ruleerrors.ErrWrongBlockVersion, "The block version should be %d", constants.BlockVersion) } */ - if header.DAAScore() >= v.hfDAAScore { - if header.Version() != constants.BlockVersionKHashV2 { - log.Warnf("After HF1 the block version should be %d - block[%d][v%d]", constants.BlockVersionKHashV2, header.DAAScore(), header.Version()) - } - } else { - if header.Version() != constants.BlockVersionKHashV1 { - log.Warnf("Before HF1 the block version should be %d - block[%d][v%d]", constants.BlockVersionKHashV1, header.DAAScore(), header.Version()) - } + if header.DAAScore() >= v.hfDAAScore && header.Version() != constants.BlockVersionKHashV2 { + log.Warnf("After HF1 the block version should be %d - block[%d][v%d]", constants.BlockVersionKHashV2, header.DAAScore(), header.Version()) + return errors.Wrapf(ruleerrors.ErrWrongBlockVersion, "The block version should be %d", constants.BlockVersionKHashV2) + } else if header.DAAScore() < v.hfDAAScore && header.Version() != constants.BlockVersionKHashV1 { + log.Warnf("Before HF1 the block version should be %d - block[%d][v%d]", constants.BlockVersionKHashV1, header.DAAScore(), header.Version()) + return errors.Wrapf(ruleerrors.ErrWrongBlockVersion, "The block version should be %d", constants.BlockVersionKHashV1) } return nil }