aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_manager.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-29 04:12:26 +0800
committerobscuren <geffobscura@gmail.com>2015-01-29 04:12:26 +0800
commit3440a8a0bfd7fbb3fd04c034356700522dec9dd4 (patch)
tree65bd52d61755094621b0ea5f5db8490c0c21481a /core/chain_manager.go
parent957f80c62303c9b9b132de1bbf05e5548cd6137a (diff)
downloaddexon-3440a8a0bfd7fbb3fd04c034356700522dec9dd4.tar.gz
dexon-3440a8a0bfd7fbb3fd04c034356700522dec9dd4.tar.zst
dexon-3440a8a0bfd7fbb3fd04c034356700522dec9dd4.zip
changed lost key
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r--core/chain_manager.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index c68b7cfc2..9646bfc53 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -251,7 +251,13 @@ func (self *ChainManager) GetBlockHashesFromHash(hash []byte, max uint64) (chain
// XXX Could be optimised by using a different database which only holds hashes (i.e., linked list)
for i := uint64(0); i < max; i++ {
- block = self.GetBlock(block.Header().ParentHash)
+ parentHash := block.Header().ParentHash
+ block = self.GetBlock(parentHash)
+ if block == nil {
+ chainlogger.Infof("GetBlockHashesFromHash Parent UNKNOWN %x\n", parentHash)
+ break
+ }
+
chain = append(chain, block.Hash())
if block.Header().Number.Cmp(ethutil.Big0) <= 0 {
break