소스 검색

Unsupport bruncles

Gustav Simonsson 10 년 전
부모
커밋
55bf5051ad
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      core/block_processor.go

+ 2 - 2
core/block_processor.go

@@ -364,8 +364,8 @@ func (sm *BlockProcessor) VerifyUncles(statedb *state.StateDB, block, parent *ty
 			return UncleError("uncle[%d](%x) is ancestor", i, hash[:4])
 		}
 
-		if !ancestors.Has(uncle.ParentHash) {
-			return UncleError("uncle[%d](%x)'s parent unknown (%x)", i, hash[:4], uncle.ParentHash[0:4])
+		if !ancestors.Has(uncle.ParentHash) || uncle.ParentHash == parent.Hash() {
+			return UncleError("uncle[%d](%x)'s parent is not ancestor (%x)", i, hash[:4], uncle.ParentHash[0:4])
 		}
 
 		if err := sm.ValidateHeader(uncle, ancestorHeaders[uncle.ParentHash], true); err != nil {