mirror of https://github.com/status-im/op-geth.git
cleanup
This commit is contained in:
parent
434dea3caf
commit
164b878854
|
@ -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)
|
// XXX Could be optimised by using a different database which only holds hashes (i.e., linked list)
|
||||||
for i := uint64(0); i < max; i++ {
|
for i := uint64(0); i < max; i++ {
|
||||||
parentHash := block.Header().ParentHash
|
block = self.GetBlock(block.ParentHash())
|
||||||
block = self.GetBlock(parentHash)
|
|
||||||
if block == nil {
|
if block == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
chain = append(chain, block.Hash())
|
chain = append(chain, block.Hash())
|
||||||
if block.Header().Number.Cmp(common.Big0) <= 0 {
|
if block.Number().Cmp(common.Big0) <= 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue