cmd/utils, core, params: explicitly pick reprice fork for fast sync

This commit is contained in:
Péter Szilágyi
2016-10-24 11:40:58 +03:00
parent 00665a0b72
commit 8639b0fae9
4 changed files with 32 additions and 7 deletions

View File

@ -248,7 +248,15 @@ func ValidateHeader(config *ChainConfig, pow pow.PoW, header *types.Header, pare
}
}
// If all checks passed, validate the extra-data field for hard forks
return ValidateDAOHeaderExtraData(config, header)
if err := ValidateDAOHeaderExtraData(config, header); err != nil {
return err
}
if config.HomesteadGasRepriceBlock != nil && config.HomesteadGasRepriceBlock.Cmp(header.Number) == 0 {
if config.HomesteadGasRepriceHash != (common.Hash{}) && config.HomesteadGasRepriceHash != header.Hash() {
return ValidationError("Homestead gas reprice fork hash mismatch: have 0x%x, want 0x%x", header.Hash(), config.HomesteadGasRepriceBlock)
}
}
return nil
}
// CalcDifficulty is the difficulty adjustment algorithm. It returns