From 7f00e8c0331bf13739e749bab88bf9006ca02f96 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Fri, 8 Jul 2016 20:59:11 +0300 Subject: core, eth: enforce network split post DAO hard-fork --- core/block_validator.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core') diff --git a/core/block_validator.go b/core/block_validator.go index 73d581328..3b597310e 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -248,6 +248,13 @@ func ValidateHeader(config *ChainConfig, pow pow.PoW, header *types.Header, pare return &BlockNonceErr{header.Number, header.Hash(), header.Nonce.Uint64()} } } + // If all checks passed, validate the extra-data field for hard forks + return ValidateHeaderExtraData(config, header) +} + +// ValidateHeaderExtraData validates the extra-data field of a block header to +// ensure it conforms to hard-fork rules. +func ValidateHeaderExtraData(config *ChainConfig, header *types.Header) error { // DAO hard-fork extension to the header validity: a) if the node is no-fork, // do not accept blocks in the [fork, fork+10) range with the fork specific // extra-data set; b) if the node is pro-fork, require blocks in the specific -- cgit