aboutsummaryrefslogtreecommitdiffstats
path: root/core/block_validator.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-10-24 16:40:58 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-10-29 17:10:00 +0800
commit8639b0fae975a5e65dea16fe5321168ac0aef128 (patch)
tree17cc166f2728551ed8999b95c690a423114e25ed /core/block_validator.go
parent00665a0b72ed93692daec21bbd79931828653228 (diff)
downloadgo-tangerine-8639b0fae975a5e65dea16fe5321168ac0aef128.tar
go-tangerine-8639b0fae975a5e65dea16fe5321168ac0aef128.tar.gz
go-tangerine-8639b0fae975a5e65dea16fe5321168ac0aef128.tar.bz2
go-tangerine-8639b0fae975a5e65dea16fe5321168ac0aef128.tar.lz
go-tangerine-8639b0fae975a5e65dea16fe5321168ac0aef128.tar.xz
go-tangerine-8639b0fae975a5e65dea16fe5321168ac0aef128.tar.zst
go-tangerine-8639b0fae975a5e65dea16fe5321168ac0aef128.zip
cmd/utils, core, params: explicitly pick reprice fork for fast sync
Diffstat (limited to 'core/block_validator.go')
-rw-r--r--core/block_validator.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/block_validator.go b/core/block_validator.go
index e5bc6178b..3f5aa10ff 100644
--- a/core/block_validator.go
+++ b/core/block_validator.go
@@ -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