good morning!!!!

Skip to content
Snippets Groups Projects
Commit 3bdf28c1 authored by Viktor Trón's avatar Viktor Trón
Browse files

GetBlockHashesFromHash(hash, max) gives back max hashes starting from PARENT of hash

parent db4aaedc
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment