diff options
author | zelig <viktor.tron@gmail.com> | 2015-01-09 13:03:26 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-01-09 13:03:26 +0800 |
commit | 3bdf28c1fef6644f17bf66a9240af5168465ad5a (patch) | |
tree | 23806b0908aaffaf0b5e1b69f335471ad87d0d0c /core | |
parent | db4aaedcbdb409e17ea3de161e7b24a80ba0a58c (diff) | |
download | go-tangerine-3bdf28c1fef6644f17bf66a9240af5168465ad5a.tar.gz go-tangerine-3bdf28c1fef6644f17bf66a9240af5168465ad5a.tar.zst go-tangerine-3bdf28c1fef6644f17bf66a9240af5168465ad5a.zip |
GetBlockHashesFromHash(hash, max) gives back max hashes starting from PARENT of hash
Diffstat (limited to 'core')
-rw-r--r-- | core/chain_manager.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go index 2d4001f0f..0b5740622 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -238,13 +238,11 @@ 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) chain = append(chain, block.Hash()) - if block.Header().Number.Cmp(ethutil.Big0) <= 0 { break } - - block = self.GetBlock(block.Header().ParentHash) } return |