diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-07-09 01:59:11 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-07-15 21:52:55 +0800 |
commit | 7f00e8c0331bf13739e749bab88bf9006ca02f96 (patch) | |
tree | 80205e861b7c510a2d3d6e432bed09badfef57fa /core | |
parent | a87089fd2dc08a69a4a4f1ef93db9a2871d819a3 (diff) | |
download | go-tangerine-7f00e8c0331bf13739e749bab88bf9006ca02f96.tar go-tangerine-7f00e8c0331bf13739e749bab88bf9006ca02f96.tar.gz go-tangerine-7f00e8c0331bf13739e749bab88bf9006ca02f96.tar.bz2 go-tangerine-7f00e8c0331bf13739e749bab88bf9006ca02f96.tar.lz go-tangerine-7f00e8c0331bf13739e749bab88bf9006ca02f96.tar.xz go-tangerine-7f00e8c0331bf13739e749bab88bf9006ca02f96.tar.zst go-tangerine-7f00e8c0331bf13739e749bab88bf9006ca02f96.zip |
core, eth: enforce network split post DAO hard-fork
Diffstat (limited to 'core')
-rw-r--r-- | core/block_validator.go | 7 |
1 files changed, 7 insertions, 0 deletions
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 |