Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 6582d00

Browse files
committed
revert: uncles must not be siblings
1 parent a12ac70 commit 6582d00

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ethereum/blocks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ def validate_uncles(self, db=None):
697697
for uncle in self.uncles:
698698
assert db is None or uncle.prevhash in self.db
699699
if uncle.number == self.number:
700-
log.warn("uncle at same block height", block=self)
700+
log.error("uncle at same block height", block=self)
701+
return False
701702

702703
# Check uncle validity
703704
ancestor_chain = [a for a in self.get_ancestor_list(MAX_UNCLE_DEPTH + 1) if a]
@@ -707,7 +708,7 @@ def validate_uncles(self, db=None):
707708
for ancestor in ancestor_chain[1:]:
708709
ineligible.extend(ancestor.uncles)
709710
ineligible.extend([b.header for b in ancestor_chain])
710-
eligible_ancestor_hashes = [x.hash for x in ancestor_chain[1:]]
711+
eligible_ancestor_hashes = [x.hash for x in ancestor_chain[2:]]
711712
for uncle in self.uncles:
712713
if not uncle.check_pow(db=db):
713714
return False

0 commit comments

Comments
 (0)