consensus,core: shortcut uncle validation

This commit is contained in:
Martin Holst Swende
2019-04-08 09:13:05 +02:00
parent 78644f0377
commit d763b49ae3
3 changed files with 23 additions and 1 deletions

View File

@ -191,6 +191,9 @@ func (ethash *Ethash) VerifyUncles(chain consensus.ChainReader, block *types.Blo
if len(block.Uncles()) > maxUncles {
return errTooManyUncles
}
if len(block.Uncles()) == 0 {
return nil
}
// Gather the set of past uncles and ancestors
uncles, ancestors := mapset.NewSet(), make(map[common.Hash]*types.Header)