Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Commit

Permalink
eth/fetcher: reuse variables for hash and number (#16819)
Browse files Browse the repository at this point in the history
  • Loading branch information
Smilenator authored and acud committed Jun 4, 2018
1 parent 7baae2c commit b0f0f35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eth/fetcher/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,20 +292,20 @@ func (f *Fetcher) loop() {
height := f.chainHeight()
for !f.queue.Empty() {
op := f.queue.PopItem().(*inject)
hash := op.block.Hash()
if f.queueChangeHook != nil {
f.queueChangeHook(op.block.Hash(), false)
f.queueChangeHook(hash, false)
}
// If too high up the chain or phase, continue later
number := op.block.NumberU64()
if number > height+1 {
f.queue.Push(op, -float32(op.block.NumberU64()))
f.queue.Push(op, -float32(number))
if f.queueChangeHook != nil {
f.queueChangeHook(op.block.Hash(), true)
f.queueChangeHook(hash, true)
}
break
}
// Otherwise if fresh and still unknown, try and import
hash := op.block.Hash()
if number+maxUncleDist < height || f.getBlock(hash) != nil {
f.forgetBlock(hash)
continue
Expand Down

0 comments on commit b0f0f35

Please sign in to comment.