core: improved uncle messages

This commit is contained in:
obscuren 2015-05-15 00:40:07 +02:00
parent b19bf3ec78
commit 580bae0a86

View File

@ -347,17 +347,17 @@ func (sm *BlockProcessor) VerifyUncles(statedb *state.StateDB, block, parent *ty
for i, uncle := range block.Uncles() { for i, uncle := range block.Uncles() {
if uncles.Has(uncle.Hash()) { if uncles.Has(uncle.Hash()) {
// Error not unique // Error not unique
return UncleError("Uncle not unique") return UncleError("uncle[%d] not unique", i)
} }
uncles.Add(uncle.Hash()) uncles.Add(uncle.Hash())
if ancestors.Has(uncle.Hash()) { if ancestors.Has(uncle.Hash()) {
return UncleError("Uncle is ancestor") return UncleError("uncle[%d] is ancestor", i)
} }
if !ancestors.Has(uncle.ParentHash) { if !ancestors.Has(uncle.ParentHash) {
return UncleError(fmt.Sprintf("Uncle's parent unknown (%x)", uncle.ParentHash[0:4])) return UncleError("uncle[%d]'s parent unknown (%x)", i, uncle.ParentHash[0:4])
} }
if err := sm.ValidateHeader(uncle, ancestorHeaders[uncle.ParentHash]); err != nil { if err := sm.ValidateHeader(uncle, ancestorHeaders[uncle.ParentHash]); err != nil {