aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wampler-Doty <matthew.wampler.doty@gmail.com>2015-02-27 23:17:31 +0800
committerMatthew Wampler-Doty <matthew.wampler.doty@gmail.com>2015-03-03 07:56:11 +0800
commit080823bdeebbab2bcffdaefad703896700ed2c30 (patch)
tree55adad53661a8c39ca77b350e303b0260e4582c9 /core
parentba1f4bbe9132103af67c0c46f81c913d6a595d77 (diff)
downloaddexon-080823bdeebbab2bcffdaefad703896700ed2c30.tar
dexon-080823bdeebbab2bcffdaefad703896700ed2c30.tar.gz
dexon-080823bdeebbab2bcffdaefad703896700ed2c30.tar.bz2
dexon-080823bdeebbab2bcffdaefad703896700ed2c30.tar.lz
dexon-080823bdeebbab2bcffdaefad703896700ed2c30.tar.xz
dexon-080823bdeebbab2bcffdaefad703896700ed2c30.tar.zst
dexon-080823bdeebbab2bcffdaefad703896700ed2c30.zip
Only one uncle
Diffstat (limited to 'core')
-rw-r--r--core/block_processor.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index efad35bf4..aef53c940 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -255,6 +255,10 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
return fmt.Errorf("GasLimit check failed for block %v, %v", block.Header().GasLimit, expl)
}
+ if len(block.Uncles()) > 1 {
+ return ValidationError("Block can only contain one uncle (contained %v)", len(block.Uncles()))
+ }
+
if block.Time() < parent.Time() {
return ValidationError("Block timestamp not after prev block (%v - %v)", block.Header().Time, parent.Header().Time)
}