aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/block_processor.go5
-rw-r--r--core/chain_manager.go5
2 files changed, 4 insertions, 6 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index d5a29b258..e3c284979 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -323,7 +323,7 @@ func (sm *BlockProcessor) VerifyUncles(statedb *state.StateDB, block, parent *ty
}
uncles.Add(block.Hash())
- for _, uncle := range block.Uncles() {
+ for i, uncle := range block.Uncles() {
if uncles.Has(uncle.Hash()) {
// Error not unique
return UncleError("Uncle not unique")
@@ -340,9 +340,8 @@ func (sm *BlockProcessor) VerifyUncles(statedb *state.StateDB, block, parent *ty
}
if err := sm.ValidateHeader(uncle, ancestorHeaders[uncle.ParentHash]); err != nil {
- return ValidationError(fmt.Sprintf("%v", err))
+ return ValidationError(fmt.Sprintf("uncle[%d](%x) header invalid: %v", i, uncle.Hash().Bytes()[:4], err))
}
-
}
return nil
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 8371a129d..4f1e1e68a 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -330,14 +330,13 @@ func (self *ChainManager) GetBlockHashesFromHash(hash common.Hash, max uint64) (
}
// XXX Could be optimised by using a different database which only holds hashes (i.e., linked list)
for i := uint64(0); i < max; i++ {
- parentHash := block.Header().ParentHash
- block = self.GetBlock(parentHash)
+ block = self.GetBlock(block.ParentHash())
if block == nil {
break
}
chain = append(chain, block.Hash())
- if block.Header().Number.Cmp(common.Big0) <= 0 {
+ if block.Number().Cmp(common.Big0) <= 0 {
break
}
}