Only one uncle

This commit is contained in:
Matthew Wampler-Doty 2015-02-27 10:17:31 -05:00
parent ba1f4bbe91
commit 080823bdee
1 changed files with 4 additions and 0 deletions

View File

@ -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)
}