diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-29 04:36:53 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-29 04:36:53 +0800 |
commit | 32fbc0d334220c4be2c2b7af856523aafa5b8a44 (patch) | |
tree | 235ca50a797295dce33e1a385b34b2901ce3f2a0 /core | |
parent | adda54ac5537b9f5e93a9b66ea6907a71da45aaf (diff) | |
parent | 1337a8dfb11160d67db410b71af92a02d6b232f5 (diff) | |
download | go-tangerine-32fbc0d334220c4be2c2b7af856523aafa5b8a44.tar go-tangerine-32fbc0d334220c4be2c2b7af856523aafa5b8a44.tar.gz go-tangerine-32fbc0d334220c4be2c2b7af856523aafa5b8a44.tar.bz2 go-tangerine-32fbc0d334220c4be2c2b7af856523aafa5b8a44.tar.lz go-tangerine-32fbc0d334220c4be2c2b7af856523aafa5b8a44.tar.xz go-tangerine-32fbc0d334220c4be2c2b7af856523aafa5b8a44.tar.zst go-tangerine-32fbc0d334220c4be2c2b7af856523aafa5b8a44.zip |
Merge branch 'develop' into qt5.4
Diffstat (limited to 'core')
-rw-r--r-- | core/chain_manager.go | 8 |
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 |