From 080823bdeebbab2bcffdaefad703896700ed2c30 Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Fri, 27 Feb 2015 10:17:31 -0500 Subject: [PATCH] Only one uncle --- core/block_processor.go | 4 ++++ 1 file changed, 4 insertions(+) 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) }