aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-19 06:09:12 +0800
committerobscuren <geffobscura@gmail.com>2015-04-19 06:09:12 +0800
commit71aa5fe8a31bdf12a38e940730e60964bbf4a1c0 (patch)
tree7a71713a6447f6a76e8f982f2527e73085473451 /core
parent84f1af6413b172c7c88d567e8b9033197196b5bd (diff)
parent164b878854b58aed833eb704579343099854735f (diff)
downloaddexon-71aa5fe8a31bdf12a38e940730e60964bbf4a1c0.tar
dexon-71aa5fe8a31bdf12a38e940730e60964bbf4a1c0.tar.gz
dexon-71aa5fe8a31bdf12a38e940730e60964bbf4a1c0.tar.bz2
dexon-71aa5fe8a31bdf12a38e940730e60964bbf4a1c0.tar.lz
dexon-71aa5fe8a31bdf12a38e940730e60964bbf4a1c0.tar.xz
dexon-71aa5fe8a31bdf12a38e940730e60964bbf4a1c0.tar.zst
dexon-71aa5fe8a31bdf12a38e940730e60964bbf4a1c0.zip
Merge branch 'downloader-proto' into develop
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
}
}